Twitter Favorites

Users favorite tweets to give recognition to awesome tweets, to curate the best of Twitter, to save for reading later, and a variety of other reasons. Likewise, developers make use of "favs" in many different ways.

Figure 1a. Instantiate Favorites
$favorites = eden('twitter')->favorites('[TWITTER_KEY]', '[TWITTER_SECRET]', $_SESSION['access_token'], $_SESSION['access_secret']);
Figure 1b. Usage: Add Favorite
$favorites->addFavorites($id);
Figure 1c. Usage: Get Favorite List
$favorites = $fav->getList();
Figure 1d. Usage: Remove Favorite
$favorites->remove($id);
Figure 1e. Favorites Methods
Method Arguments Returns Description
$favorites->addFavorites($id);
  1. int
  2. - The numerical ID of the desired status.
array Favorites the status specified in the ID parameter as the authenticating user.
$favorites->getList(); none array Returns the 20 most recent favorite statuses for the authenticating user or user specified by the ID parameter in the requested format.
$favorites->remove($id);
  1. int
  2. - The numerical ID of the desired status.
array Un-favorites the status specified in the ID parameter as the authenticating user.
$favorites->setUserId($id);
  1. int|string
Eden_Twitter_Favorites The ID of the user for whom to return results for. Either an id or screen_name is required for this method.
$favorites->setCount($count);
  1. int|string
Eden_Twitter_Favorites Specifies the number of records to retrieve. Must be less than or equal to 200. Defaults to 20.
$favorites->setSinceId($sinceId);
  1. integer
Eden_Twitter_Favorites Returns results with an ID greater than (that is, more recent than) the specified ID. There are limits to the number of Tweets which can be accessed through the API. If the limit of Tweets has occured since the since_id, the since_id will be forced to the oldest ID available.
$favorites->setMaxId($maxId);
  1. integer
Eden_Twitter_Favorites Returns results with an ID less than (that is, older than) or equal to the specified ID.
$favorites->setPage($page);
  1. integer
Eden_Twitter_Favorites Specifies the page of results to retrieve.
$favorites->includeEntities(); none Eden_Twitter_Favorites When set to either true, t or 1, 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. While entities are opt-in on timelines at present, they will be made a default component of output in the future. See Tweet Entities for more detail on entities.

© 2012 Openovate Labs. All rights reserved.