python - 使用 Python 的旧推文 Tweepy

标签 python twitter tweepy

我正在尝试使用 Python 中的 tweepy 获取较旧的推文数据(大约 2 个月前)。我尝试了 since 和 until 参数但没有成功。有没有人在 tweepy 或其他一些 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')])

最佳答案

这是不可能的。 The docs on the Twitter API are very clear :

The Twitter Search API searches against a sampling of recent Tweets published in the past 7 days.

没有比这更远的搜索方式了。

关于python - 使用 Python 的旧推文 Tweepy,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37017903/

相关文章:

python - 在 2 个列表中查找最接近的日期时间

jquery - Twitter API 计数参数

python - 尝试在 Google Colab 上将 Twitter API Bearer Token 与 Tweepy 一起使用时出现此错误消息是什么意思

python - 通过 Streaming API 下载 Twitter 数据时出现错误

python - 如何使用 tweepy 流式传输来自指定用户的推文(仅当该用户发布推文时才流式传输)

python - TypeError : request() got an unexpected keyword argument 'header' - when i use header, 403 错误 - 没有 header

python - Pyramid 中的许可基础结构有什么意义?

python - 空列表的正确类型提示是什么?

api - Twitter API:如何仅搜索经过地理标记的推文

ios - 防止用户修改 SLComposeViewController 中的部分文本