Twitter API accessor methods

Accessor Methods

These methods require a GET operation for extracting data from Twitter and are split into the following categories:

  •  Account methods

The account/rate_limit_status method returns the number of requests that a user has remaining before his limit is refreshed.At the time of this writing,users had approximately 150 requests available to them per hour.The account/verify_credentials method checks whether a user’s credentials,in the form of a username and password or OAuth tokens,are valid and returns an error or User object  if successful. www.it-ebooks.info

  • Block methods 

The blocks/blocking method returns a collection of users that a user has blocked on Twitter.The blocks/blocking/ids method returns the same collection of users as the blocks/blocking method,although you are given only their user identifiers.The blocks/exists/<<id>> method checks whether a specified user has been blocked by the authenticated user.

  • Direct messages methods

The direct_messages method retrieves a number of messages that a user has received and works alongside the direct_messages/sent method,which refers to the messages that the authenticated user has sent.

  • Favorites methods

The favorites method returns a number of updates that a user has marked as a favorite.Favorites in Twitter are similar to bookmarks in a web browser.

  •  Friendships methods

The friendships/exists method returns a simple true or false if two users are following each other.In addition,the friendships/show method can be used to extract more detailed information,such as whether the follow is reciprocated.

  • Help methods

The help/test method can be used to check whether the Twitter API is up and running and does not count toward a user’s rate limit.

  • Saved searches methods

The saved_searches method returns a list of search terms that the authenticated user has saved.A particular search can be retrieved via the saved_searches/show/<<id>> method.

  • Search methods

The search method is used to perform powerful searches and is covered in detail in the front

  •  Social graph methods

The followers/ids and friends/ids methods return the identifiers of all the followers and friends a user has.For users with large numbers of connections,this can be iterated over to retrieve them all.

  • Status methods

The statuses/retweets/<<id>> method retrieves a number of statuses that have “retweeted”the original <<id>> update.The statuses/show/<<id>> method simply returns the Status object (see Chapter 2) for a given <<id>>.

  • Timeline methods

The statuses/friends_timeline, statuses/home_timeline, statuses/public_timeline and statuses/user_timeline methods return a collection of Status www.it-ebooks.info objects (see Chapter 2) for a user’s friends,everyone on Twitter,or a specific user.In addition,mentions (updates that reference a particular user) of the authenticated user can be retrieved through the statuses/mentions method.Three retweet
methods exist and are covered in Chapter 4: statuses/retweeted_by_me, statuses/retweets_of_me,and statuses/retweeted_to_me.

  •  Trends methods

The trends method can be used to return the topics that are currently “trending” on Twitter.To refine this search,you can also use the trends/current, trends/ daily,and trends/weekly methods.In addition to these three methods,Twitter has two “local trends”methods—trends/available and trends/location—which
return trends for a given area (for example,the buzz in London or San Francisco).

  • User methods

The final set of methods is for returning details about users such as extracting the details of followers (statuses/followers) and friends (statuses/friends),but also for specific users via the users/show and users/lookup methods.Twitter enables you to search for users via the users/search method,and to access suggested users through the users/suggestions and users/suggestions/<<category>> methods.