开发者

Retrieve tweets of a twitter account starting from certain date to current date

I want to write a script that retrieve the tweets from a twitter account. Here is the scenario that I would like to achieve: my script should be able to retrieve all tweets of a user starting from certain date (can be set by the user to any date as long as it's older than current date), until current date.

Example: I want to grab all the tweets of a user from 1st January 2011 until current date (e.g. 10th June 2011)

My question: how to achieve that? I don't need code, I just need the logic or flow of the scenario. Any suggestions or answers are much appreciated. Thank you.

NOTE: The script is written in Python which make use of the python-twitter library to talk to Twitter API. It's also possible to talk directly to the Twitter API without the help of the library if required. This script will be used as a 'desktop application' not web appli开发者_JAVA技巧cation.


If you're happy with a limit of 3000 statuses you could look at this method. Keep repeating this call to the next page until the first tweet of one of the pages is earlier than the date you're trying to map from.

All you need to do then is iterate through the list while date >= 01/01/2011, and slice it at that point.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜