checkRateLimit('favorites', 'list'); // Set the API path. $path = '/favorites/list.json'; // Determine which type of data was passed for $user if (is_numeric($user)) { $data['user_id'] = $user; } elseif (is_string($user)) { $data['screen_name'] = $user; } // Set the count string $data['count'] = $count; // Check if since_id is specified. if ($since_id > 0) { $data['since_id'] = $since_id; } // Check if max_id is specified. if ($max_id > 0) { $data['max_id'] = $max_id; } // Check if entities is specified. if (!is_null($entities)) { $data['include_entities'] = $entities; } // Send the request. return $this->sendRequest($path, 'GET', $data); } /** * Method to favorite the status specified in the ID parameter as the authenticating user * * @param integer $id The numerical ID of the desired status. * @param boolean $entities When set to true, each tweet will include a node called "entities,". This node offers a variety * of metadata about the tweet in a discreet structure, including: user_mentions, urls, and hashtags. * * @return array The decoded JSON response * * @since 12.3 */ public function createFavorites($id, $entities = null) { // Set the API path. $path = '/favorites/create.json'; $data['id'] = $id; // Check if entities is specified. if (!is_null($entities)) { $data['include_entities'] = $entities; } // Send the request. return $this->sendRequest($path, 'POST', $data); } /** * Method to un-favorites the status specified in the ID parameter as the authenticating user. * * @param integer $id The numerical ID of the desired status. * @param boolean $entities When set to true, each tweet will include a node called "entities,". This node offers a variety * of metadata about the tweet in a discreet structure, including: user_mentions, urls, and hashtags. * * @return array The decoded JSON response * * @since 12.3 */ public function deleteFavorites($id, $entities = null) { // Set the API path. $path = '/favorites/destroy.json'; $data['id'] = $id; // Check if entities is specified. if (!is_null($entities)) { $data['include_entities'] = $entities; } // Send the request. return $this->sendRequest($path, 'POST', $data); } }