0

我正在尝试使用 rtweet 包从特定位置(例如“LA”)获取推文。我知道 twitteR 包曾经有类似的东西:

a<-searchTwitter("sydney", n=100, geocode='-33.871841,151.206709, 10000mi')

您甚至可以指定半径。

有没有办法将该功能添加到 rtweet 流?

4

1 回答 1

0

来自rtweet

library(rtweet)
rt <- search_tweets(
  "lang:en", geocode = lookup_coords("usa"), n = 10000
)

帮助页面中的流示例:

stream_tweets(
  "realdonaldtrump,trump",
  timeout = 60 * 60 * 24 * 7,
  file_name = "tweetsabouttrump.json",
  parse = FALSE,
  lookup_coords("usa")
)

但是您需要一个 Google Maps API 密钥lookup_coords(请参见此处)。

更多herehere

于 2018-08-23T09:19:37.273 回答