【发布时间】:2018-08-21 02:28:18
【问题描述】:
由于免费的 Twitter API 只允许您搜索最近 7 天的数据,因此我尝试自动设置这 7 天的日期。当我将日期字段留空时,我会收到随机的历史推文。
#### Pepsi
#Dates for API
s <- as.Date(Sys.Date()-7, format = "%Y/%m/%d")
e <- as.Date(Sys.Date(), format = "%Y/%m/%d")
#Pepsi Twitter Data
pepsitweet <- searchTwitter("Pepsi",n=1000,lang="en", since = "s", until = "e")
tweets1 <- twListToDF(pepsitweet)
错误
请求了 1000 条推文,但 API 只能返回 0
as.POSIXlt.character(x, tz, ...) 中的错误: 字符串不是标准的明确格式
【问题讨论】: