2016-09-29 145 views
0

如果添加一个短语搜索选项“直到”,很容易发现,Twitter的API为鸣叫的年龄不超过10天:Tweepy api.search,如何获取超过10天的推文?

screenshot

今天,9月29日,最后tweet收到19!

示例代码:

api = tw_oauth('./auth.k') 

def limit_handled(cursor): 
    while True: 
     try: 
      yield cursor.next() 
     except tweepy.RateLimitError: 
      time.sleep(15 * 60) 

for tweet in limit_handled(tweepy.Cursor(api.search, q='python until:2016-09-20', count = 20).items()): 
    print (tweet.id, tweet.created_at) 

我如何鸣叫超过10天的?

例如,如果您需要大量推文Spars(超过每日限制,并且允许您必须中断进程)。

+0

可能的重复[使用Python的旧推文Tweepy](http://stackoverflow.com/questions/37017903/older-tweets-tweepy-using-python) – Efferalgan

回答