Thursday, April 1, 2010

The Learning Ramp for the Twitter API:REST API Methods.

The REST API method allows you to use all the core data from twitter, so the API's here let you do just about anything twitter does. The link is included for information on each of the methods which can be seen here. I will use an example using the user method for returning tweets about a specific user give their user id. To this you need the id of user you want to see. You can find how to find the id number by going here. I will be showing you how use this method to retweet a post from Jamie Oliver(The Naked Chef).

  • URL to use in your browser
    •  http://api.twitter.com/1/users/show.xml?user_id=1401881
  • Valid Formats
    • json
    • xml
  • The HTTP method is GET
  • The id for Jamie Oliver is 18676177
  • So now you simply do the following
    • http://api.twitter.com/1/users/show.xml?user_id=1867177
    • http://api.twitter.com/1/users/show.json?user_id=18676177
If do this in you Firefox web browser you should see the tweets made by Jamie Oliver. Of course you can use this in your app by placing it in your code. I will try and put up an example of this soon.



No comments:

Post a Comment