简体   繁体   English

如何使用 tweepy.api 搜索一个多月的推特回复?

[英]How to search twitter replies more than a month using tweepy.api?

I'm trying to find replies to a specific user of a specific tweet ID using code:我正在尝试使用代码查找对特定推文 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]

I'm using 'to:'+name to find replies to a specific user and tweets_df['Reply_ID'] == tweet_id to match the replies.我使用'to:'+name来查找对特定用户的回复,并使用tweets_df['Reply_ID'] == tweet_id来匹配回复。 However, the result of the initial data frame tweets_df before filtering the tweet ID only gives the reply tweets within a month.但是,过滤推文ID之前的初始数据帧tweets_df的结果仅给出一个月内的回复推文。

How can I get more replies starting from the 25-Jan?从 1 月 25 日开始,我怎样才能得到更多回复?

The legacy standard Twitter search API - which is what this Tweepy function is using - can only provide Tweets going back within the past 7 days.传统的标准 Twitter 搜索 API——这是这个 Tweepy 函数所使用的——只能提供过去 7 天内回溯的推文。 For a longer period, you need to use the premium 30-day or full-archive search APIs from Twitter.对于更长的时间,您需要使用 Twitter 提供的高级 30 天或完整归档搜索 API。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何使用 twitter 搜索 API v2 和 Tweepy 获取 python 中的所有推文(超过 100 条)和关联的用户字段? - How to get all tweets (more than 100) and associated user fields in python using twitter search API v2 and Tweepy? 如何使用 Tweepy 多次调用 Twitter API 以获取每个用户超过 200 条推文? - How to make multiple calls to Twitter API to get more than 200 Tweets per user using Tweepy? 使用 tweepy 搜索 api 无法获得超过 600 条推文 - Cant get more than 600 tweets using tweepy search api tweepy如何搜索多个字符串? - How to search tweepy for more than one string? 使用 Tweepy 和 Twitter API v2 从单个推文中检索回复 - Using Tweepy and Twitter API v2 to retrieve replies from a single Tweet 如何使用Twython从twitter搜索或流式api获取超过100条推文 - how to get more than 100 tweets from the twitter search or streaming api using Twython 如何在 Tweepy 中为 API.search 的地理编码参数指定多个坐标 - How to specify more than one coordinates for geocode parameter of API.search in Tweepy AttributeError:使用 Tweepy 和 Twitter API - AttributeError: using Tweepy and Twitter API 如何在tweepy的一条推文中搜索多个单词? - How to search more than one word in a single tweet at the tweepy? Tweepy(Twitter API)不返回所有搜索结果 - Tweepy (Twitter API) Not Returning all Search Results
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM