views:

191

answers:

4

I studied the Twitter API Documentation today. Only find that we could use "Twitter REST API Method: statuses user_timeline" to acquire statuses of a certain user. Retweets are stripped out of the user_timeline for backwards compatibility reasons. If I want retweets included, API Documentation recommend "statuses retweeted_by_me", but retweeted_by_me cannot return the retweets by other users.

I think maybe we can analyse the twitter webpage of a certain user to get his retweets. However is there any elegant way to crawl retweets of a certain user?

Thanks in advance!

A: 

You want to use the retweeted_to_me API call and then create a union with user_timeline and sort by datetime. It's a little annoying that they don't mix the stream for you.

Dead account
A: 

Thank you! But your method can only find all the tweets and retweets by myself. My purpose is to crawl other twitterers' tweets and retweets. Since retweets appear with 'RT' in RSS and Atom, now I plan to use the RSS to find what I want. twitter4j.examples.FeedMonitor is a good example for processing RSS.

Xiong
A: 

Call statuses/user_timeline for the specific user then for each status you will have to call either statuses/id/retweeted_by or statuses/retweets.

http://apiwiki.twitter.com/Twitter-REST-API-Method:-GET-statuses-id-retweeted_by http://apiwiki.twitter.com/Twitter-REST-API-Method:-statuses-retweets

abraham
+2  A: 

This was addressed recently by the Twitter devs. You can now add a include_rts=true to your call to user_timeline. See the full discussion here: http://groups.google.com/group/twitter-development-talk/browse_thread/thread/7a4be385ff549ed0

related questions