![](/img/trans.png)
[英]How to get all tweets (more than 100) and associated user fields in python using twitter search API v2 and Tweepy?
[英]How to search twitter replies more than a month using tweepy.api?
我正在嘗試使用代碼查找對特定推文 ID 的特定用戶的回復:
tweets = tweepy.Cursor(api.search,q='to:'+name, tweet_mode='extended').items()
tweets_list = [[tweet.created_at, tweet.id,
tweet.full_text.encode('utf-8'),
tweet.in_reply_to_status_id_str] for tweet in tweets]
tweets_df = pd.DataFrame(tweets_list,columns=['Datetime', 'Tweet Id', 'Text', 'Reply_ID'])
tweets_df2 = tweets_df[tweets_df['Reply_ID'] == tweet_id]
我使用'to:'+name
來查找對特定用戶的回復,並使用tweets_df['Reply_ID'] == tweet_id
來匹配回復。 但是,過濾推文ID之前的初始數據幀tweets_df
的結果僅給出一個月內的回復推文。
從 1 月 25 日開始,我怎樣才能得到更多回復?
傳統的標准 Twitter 搜索 API——這是這個 Tweepy 函數所使用的——只能提供過去 7 天內回溯的推文。 對於更長的時間,您需要使用 Twitter 提供的高級 30 天或完整歸檔搜索 API。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.