rtweet 库是否有办法从特定位置获取推文?
Does the rtweet library have a way to fetch tweets from a specific location?
我正在尝试获取从特定位置发布的推文,例如'LA' 使用 rtweet 包。
我知道 twitteR 包曾经有类似的东西:
a<-searchTwitter("sydney", n=100, geocode='-33.871841,151.206709, 10000mi')
您甚至可以指定半径。
有没有办法将该功能添加到 rtweet 流中?
来自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 地图 API lookup_coords
的密钥(参见 here)。
我正在尝试获取从特定位置发布的推文,例如'LA' 使用 rtweet 包。 我知道 twitteR 包曾经有类似的东西:
a<-searchTwitter("sydney", n=100, geocode='-33.871841,151.206709, 10000mi')
您甚至可以指定半径。
有没有办法将该功能添加到 rtweet 流中?
来自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 地图 API lookup_coords
的密钥(参见 here)。