我如何递归地收集所有 Twitter 回复?
How do I recursively collect all Twitter replies?
我最近刚刚在 Twitter 上与多人进行了将近 6 周的对话。由于所说的几件事非常有趣(尤其是事后看来),我希望能够将整个对话存档以供日后参考。据我所知,没有类似于 threadreaderapp.com to recursively unroll an entire conversation. As such, I looked into doing it in Python with the Twitter API. In researching it, I found several people saying the free version of the API only lets you search replies from the last 7 days. However, then I found some places (e.g., here) that seemed to indicate the Twitter API v2 added access to a "conversation ID" that enabled this limitation to be avoided. However, when I tried to run that code to get the replies to my tweet, the response kept coming back empty. Specifically, as best I can tell, the request from line 19 of this code (link ... which is the code from step 7 of the previously mentioned article: direct link) is not returning data.
的现有解决方案
我错过了什么吗?是否可以递归地获取过去 6 周内对推文的所有回复,而无需被视为“学术研究员”才能访问完整的 Twitter 存档 (reference)?
最终,我可以在浏览器中获取网站上的所有推文,所以我想如果我知道自己在做什么,我可以只使用某种 HTML 抓取工具之类的东西,但我不知道't.
Twitter API v2 允许您使用 conversation_id
作为最近搜索和完整存档搜索端点的搜索参数。不同之处在于,最近的搜索 API 涵盖了过去 7 天(在基本访问级别/大多数用户中可用),而完整档案搜索 API 目前仅限于学术访问。
因此,要直接回答您的问题:否,API 不允许您递归获取过去 6 周内对推文的所有回复,除非您确实是一名合格的学术研究人员,可以使用完整的档案搜索功能。
其他检索方法超出了API的范围,Twitter不支持。
我最近刚刚在 Twitter 上与多人进行了将近 6 周的对话。由于所说的几件事非常有趣(尤其是事后看来),我希望能够将整个对话存档以供日后参考。据我所知,没有类似于 threadreaderapp.com to recursively unroll an entire conversation. As such, I looked into doing it in Python with the Twitter API. In researching it, I found several people saying the free version of the API only lets you search replies from the last 7 days. However, then I found some places (e.g., here) that seemed to indicate the Twitter API v2 added access to a "conversation ID" that enabled this limitation to be avoided. However, when I tried to run that code to get the replies to my tweet, the response kept coming back empty. Specifically, as best I can tell, the request from line 19 of this code (link ... which is the code from step 7 of the previously mentioned article: direct link) is not returning data.
的现有解决方案我错过了什么吗?是否可以递归地获取过去 6 周内对推文的所有回复,而无需被视为“学术研究员”才能访问完整的 Twitter 存档 (reference)?
最终,我可以在浏览器中获取网站上的所有推文,所以我想如果我知道自己在做什么,我可以只使用某种 HTML 抓取工具之类的东西,但我不知道't.
Twitter API v2 允许您使用 conversation_id
作为最近搜索和完整存档搜索端点的搜索参数。不同之处在于,最近的搜索 API 涵盖了过去 7 天(在基本访问级别/大多数用户中可用),而完整档案搜索 API 目前仅限于学术访问。
因此,要直接回答您的问题:否,API 不允许您递归获取过去 6 周内对推文的所有回复,除非您确实是一名合格的学术研究人员,可以使用完整的档案搜索功能。
其他检索方法超出了API的范围,Twitter不支持。