获取对推文的所有回复 (Tweepy) 仅提取最近的 50 条推文

问题描述

我正在寻找对推文的回复

https://twitter.com/ChrisCillizza/status/911224143022092289

为此,我设置了我的帐户

api_key = 'REDACTED'
api_secret_key = 'REDACTED'
access_token = 'REDACTED'
access_token_secret = 'REDACTED'
auth = tweepy.OAuthHandler(api_key,api_secret_key)
auth.set_access_token(access_token,access_token_secret)
api_out = tweepy.API(auth)

然后我拉出有问题的推文

tweet_id = 911224143022092289
tweet = api_out.get_status(tweet_id) ## This gets the tweet object
tweet_text = tweet.text ## The tweets text
tweet_user = tweet.user.screen_name ## The screen name of the user making teh tweet
tweet_date = tweet.created_at ## The date of the tweet

然后我使用这条推文中的信息来尝试提取回复

tmpTweets = api_out.search(q='to:{}'.format(tweet_user),tweet_mode='extended',count=1000) ## Get 
the tweets mentioning the user since the tweet

我终于尝试过滤推文以让回复的人回复

for tw in tmpTweets : ## Cycle through every tweet pulled
    if tw.in_reply_to_status_id == tweet_id : ## If this tweet mentioning the user was in reply to the tweet we're interested in
        replies.append(tw)
    else :
        print(str(tw.in_reply_to_status_id) + " " + str((tw.created_at)))

但是我最终得到的数据集只有 55 条推文,而且都是从今天开始的。
这令人困惑有两个原因 --

(1) Why is it not finding tweets related to the original?
(2) Why is it only pulling the most recent 55 tweets? 

如果我假设上面 (1) 的答案是“这条推文太旧了”,我希望以该用户最近的 1000 次提及结束,但我只收到最近的 50 次。

谢谢

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)