如何获取特定时间段内所有推文的样本? [英] How can I obtain a sampling of all tweets from a specific time period?

查看:39
本文介绍了如何获取特定时间段内所有推文的样本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想收集过去一年中所有推文的样本.能够请求来自特定日期的推文会很棒,但我会尽我所能.

I want to gather samplings of all tweets from the past year. Being able to request tweets from a specific date would be great, but I'll take what I can get.

我不想查找特定用户的推文或包含特定术语的推文,只想查找所有推文的样本.Twitter 搜索 API 声称查询词是可选的,但如果我尝试像

I do not want to find tweets by a specific user or containing a specific term, just a sampling of all tweets. The Twitter search API claims that a query term is optional, but if I try an empty query like

http://search.twitter.com/search.atom  

与给出搜索词相反,

http://search.twitter.com/search.atom?q=twitter  

响应是

<hash>
<error>
You must enter a query.
</error>
</hash>

如果 API 确实没有为此类查询提供任何功能,我该如何绕过它?推文 ID 是否大致按日期顺序排列,我能否以某种方式使用此信息来抓取以我知道日期的推文 ID 为中心的成串推文?

If the API really doesn't provide any functionality for this type of query, how can I hack around it? Are tweet ids roughly sequential by date and can I somehow use this info to grab bunches of tweets centered around an id of a tweet whose date I know?

推荐答案

您正在引用过时的文档.如果您阅读当前版本,您会发现query是必需的.

You are referencing the obsolete documentation. If you read the current version you will find that a query is required.

您还应该知道,Search API 仅提供大约两周前的结果.您或许可以从 infochimps 等网站中找到历史数据.

You should also know that the Search API only provides results going back about two weeks. You might be able to find historical data from sites like infochimps.

这篇关于如何获取特定时间段内所有推文的样本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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