通过 Twitter Streaming API 获取所有过去的推文 [英] Get all past tweets via Twitter Streaming API

查看:64
本文介绍了通过 Twitter Streaming API 获取所有过去的推文的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何通过 Twitter Streaming API 获取所有过去的推文?您可能知道它发送实时推文,而不是过去的推文.有用的计数参数在 2010 年被禁用.REST API 有如此严重的限制,以至于需要一生才能获得所有过去的推文.有什么解决办法吗?

How can i get all past tweets via Twitter Streaming API? As you may know it sends real-time tweets, not past ones. Useful count parameter was disabled in 2010. REST API have so bad limitations that it would take a whole life to get all past tweets. Is there any solution?

推荐答案

抱歉,您无法从 streaming API 除非您具有更高的访问权限(例如 Firehose、Retweet、Link、Birddog 或 Shadow).您可以通过向 api at twitter dot com 发送电子邮件来请求更多访问权限.请注意,您不能将track参数与一起使用>计数.

Sorry, you can't get historical tweets from the streaming API unless you have elevated access (e.g., Firehose, Retweet, Link, Birddog or Shadow). You can request additional access by emailing api at twitter dot com. Note that you cannot use the track parameter with count.

使用计数时,只能使用通过 Twitter 发送的最后 150,000 个状态.引用 Twitter 文档:

Only the last 150,000 statuses sent through Twitter are available when using count. To quote the Twitter docs:

在未过滤的流上,所有考虑的状态都会被传递,所以请求的数字就是返回的数字.在过滤的流上,请求的数量是应用于过滤谓词的状态数量,而不是返回的状态数量.

On unfiltered streams, all considered statuses are delivered, so the number requested is the number returned. On filtered streams, the number requested is the number of statuses that are applied to the filter predicate, and not the number of statuses returned.

此外,包含最后 150,000 条推文的循环缓冲区受制于他们正在从 Twitter 流出.因此,如果当前推文速率为每秒 600 条推文,则缓冲区仅保存最后 250 秒的数据,如果您只对少数用户感兴趣,则缓冲区中可能不会超过几条推文,如果有的话.

Also, that circular buffer containing the last 150,000 tweets is subject to the rate in which they are flowing out of Twitter. So, if the current tweet rate is 600 tweets per second, the buffer only holds the last 250 seconds of data, and if you are interested in just a few users, there probably won't be more than just a couple tweets in the buffer, if any.

如果您通过了身份验证,REST API 允许您每天提取 1,680,000 条推文,但真正的限制因素是您只能获得每个用户 3,200 条推文.搜索 API 更糟糕,因为它目前似乎只返回来自特定目标的大约四天的推文.

If you're authenticated, the REST API will allow you to pull 1,680,000 tweets per day, but the real limiting factor is that you can only get at 3,200 tweets per user. The search API is worse, since it currently seems to be returning only about four days worth of tweets from a specific target.

注意:在 abraham 提出计数后编辑仍然可用,并具有对流 API 的更高访问权限.

这篇关于通过 Twitter Streaming API 获取所有过去的推文的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆