gpt4 book ai didi

python - 使用 Python 的旧推文 Tweepy

转载 作者:太空宇宙 更新时间:2023-11-04 07:35:30 24 4
gpt4 key购买 nike

我正在尝试使用 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/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com