我需要一种方法来计算给定标签在 Twitter 上的出现次数,以便我准确知道在 Twitter 上找到了多少。
主要想法是使用简单的“搜索”API,但是,我需要遍历许多页面才能确切知道有多少,而且页面有一个“限制”(即 1500 条推文) ,因此,如果推文超过 1500 条,我会将其解读为 1500。
是否有任何其他“智能”和改进的方法来做到这一点?
谢谢
最佳答案
一句话,没有。来自1.1 API docs :
Please note that Twitter's search service and, by extension, the Search API is not meant to be an exhaustive source of Tweets. Not all Tweets will be indexed or made available via the search interface.
您能做的最好的事情就是搜索允许的最大推文并遍历页面。然后,您可以使用 since_id
参数为下一批 1500 条启动另一次搜索。这样您就可以通过时间倒退,一次 1500 条推文,只要您想要(或只要因为 Twitter 提供推文)。
祝你好运
关于javascript - 用于计算标 checkout 现次数的 Twitter API,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15142935/