Our application will utilize the Twitter API via the jQuery
ajax() calls. In this section, we will review the particular Twitter API methods used in the application.
The Social media site Twitter has a web based API for desktop or mobile applications to post data or query existing data in Twitter. The API has the REST (Representational State Transfer) architectural style and is accessible via the HTTP protocol. Detailed documentation for the API can be found in the official Twitter API docs.
In our sample application, we will use two API methods:
user_timeline method returns the most recent tweets posted by a user. If the user whose tweets are requested has protected them, then you can access those tweets only if you are authenticated and the user who owns those tweets has accepted your follow request. To keep things simple, our application does not facilitate any means of authentication to Twitter. For this reason, we can access only those tweets that are not protected. Many organizations use Twitter to stay in touch with their customers. Therefore, to encourage followers, they do not protect their tweets. For example, many news organizations tweet breaking news in their Twitter account. Our sample application can be used to access the latest tweets by any Twitter account as long as it is not protected.
Get the Full Series!
Joining Tuts+ Premium. . .
For those unfamiliar, the family of Tuts+ sites runs a premium membership service called Tuts+ Premium. For $19 per month, you gain access to exclusive premium tutorials, screencasts, and freebies from Mobiletuts+, Nettuts+, Aetuts+, Audiotuts+, Vectortuts+, and CgTuts+. For the price of a pizza, you’ll learn from some of the best minds in the business. Become a premium member to access this tutorial, as well as hundreds of other advanced tutorials and screencasts.