较旧的推文 Tweepy 使用 Python [英] Older tweets Tweepy using Python
本文介绍了较旧的推文 Tweepy 使用 Python的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试使用 Python 中的 tweepy 获取较旧的推文数据(大约 2 个月大).我试过自和直到参数但没有成功.有没有人在 tweepy 或其他一些 API 中得到解决.
I am trying to get older tweet data (approximately 2 months old) using tweepy in Python. I tried since and until parameters but no success. Has anyone got a work around in tweepy or some other API.
for id,tweet in enumerate (tweepy.Cursor(api.search, q='SpecificWord', since="2016-04-26", until="2016-04-28", lang="en", include_retweets=False ).items(200)):
#Write a row to the csv file
CSVW.writerow([tweet.created_at, tweet.retweet_count, tweet.text.encode('utf-8')])
推荐答案
这是不可能的.Twitter API 上的文档非常清楚:
Twitter Search API 会根据过去 7 天内发布的近期推文样本进行搜索.
The Twitter Search API searches against a sampling of recent Tweets published in the past 7 days.
没有比这更进一步搜索的方法了.
There is no way to search back further than that.
这篇关于较旧的推文 Tweepy 使用 Python的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文