Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
124
rated 0 times [  129] [ 5]  / answers: 1 / hits: 91238  / 12 Years ago, mon, november 19, 2012, 12:00:00

I wrote a small JavaScript a couple of years ago that grabbed a users (mine) most recent tweet and then parsed it out for display including links, date etc.



It used this json call to retrieve the tweets and it no longer works.



http://twitter.com/statuses/user_timeline/radfan.json


It now returns the error:



{errors:[{message:Sorry, that page does not exist,code:34}]}


I have looked at using the api version (code below) but this requires authentication which I would rather avoid having to do as it is just to display my latest tweet on my website which is public anyway on my profile page:



http://api.twitter.com/1/statuses/radfan.json


I haven't kept up with Twitter's API changes as I no longer really work with it, is there a way round this problem or is it no longer possible?


More From » twitter

 Answers
42

As you can see in the documentation, using the REST API you'll need OAuth Tokens in order to do this. Luckily, we can use the Search (which doesn't use OAuth) and use the from:[USERNAME] operator



Example:
http://search.twitter.com/search.json?q=from:marcofolio

Will give you a JSON object with tweets from that user, where



object.results[0]


will give you the last tweet.


[#81914] Saturday, November 17, 2012, 12 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
stephonkeandrer

Total Points: 392
Total Questions: 94
Total Answers: 100

Location: Tajikistan
Member since Sun, Aug 29, 2021
3 Years ago
;