我使用的是Tweepy,但正如我在链接(Older tweets Tweepy using Python)中发现的那样,我无法使用tweppy获取更老的推文。
我找到了一些库来获取较旧的tweet,但我无法根据它们的ID获取它们。
有人知道我怎么才能得到它吗?
发布于 2020-07-20 22:11:06
我相信你可以使用tweepy来查找推文,不管他们使用get_status()有多老
示例
# import tweepy
import tweepy
# api keys from twitter developers
consumer_key='<your consumer_key here>'
consumer_secret='<your consumer_secret here>'
access_token='<your access_token here>'
acess_token_sectret='<your acess_token_sectret here>'
# login to twitter 
auth = tweepy.OAuthHandler(consumer_key, consumer_secret)
auth.set_access_token(access_token, acess_token_sectret)
auth.secure = True
api = tweepy.API(auth)
# define the id of the tweet you are looking for
id = 1181329749966295041
# get the tweet
tweet = api.get_status(id)
# print the text of the tweet
print(tweet.text)https://stackoverflow.com/questions/62850844
复制相似问题