4

我正在尝试使用 twitteR 函数“searchTwitter”检索约 3000 条带有关键字“nba”或主题标签“#nba”的推文,但在 2013 年 1 月 1 日和2014 年 2 月 25 日。我真的很困惑,这正常吗?有没有其他人在使用 twitteR 时遇到过类似的问题?请帮忙。非常感激!

library(twitteR)
library(plyr)
library(stringr)

load("~/twitter_authentication.Rdata")
registerTwitterOAuth(cred)

nbahash_tweets = searchTwitter("#nba",since='2013-01-01', until='2014-02-25',n=3000)

nba_tweets = searchTwitter("nba",since='2013-01-01', until='2014-02-25',n=3000)


Warning message:
In doRppAPICall("search/tweets", n, params = params, retryOnRateLimit = retryOnRateLimit,  :
  3000 tweets were requested but the API can only return 398

接着

Warning message:
In doRppAPICall("search/tweets", n, params = params, retryOnRateLimit = retryOnRateLimit,  :
  3000 tweets were requested but the API can only return 299
4

1 回答 1

12

这是由于 Twitter 的 Search API 的限制。在 Twitter 的常见问题解答中,我发现了以下问题: 为什么我要查找的推文不在 Twitter 搜索、搜索 API 或搜索小部件中?

那里写着:

由于容量限制,该索引目前仅涵盖大约一周的推文。

因此,即使您想从 2013 年 1 月 1 日开始下载推文,您最多只能收到一周前的推文。所以推文的数量不会那么大。

此外,他们说:

我们的搜索服务并不意味着是公开推文的详尽存档,并且并非所有推文都被索引或返回。

因此,可用的推文将更少。

因此,据我所知,您的代码应该没问题,并且下载的推文数量很少是由于 Search API。

于 2014-08-07T20:42:51.777 回答