【发布时间】:2015-02-08 04:16:41
【问题描述】:
我正在使用 R 并希望使用 CRAN 上提供的 twitteR 包。
我使用以下方式安装了 twitteR 软件包:
install.packages(twitteR)
然后加载包:
library(twitteR)
之后我想运行第一个命令来获取 twitter 上的最新趋势:
getTrends(period="weekly")
显示以下错误:
Error in getTrends(period = "weekly") :
argument "woeid" is missing, with no default
还有命令:
searchTwitter("#orms")
显示错误,即:
Error in twInterfaceObj$doAPICall(cmd, params, "GET", ...) :
OAuth authentication is required with Twitter's API v1.1
还有命令:
userTimeline("informs")
有错误输出:
Error in twInterfaceObj$doAPICall(cmd, params, method, ...) :
OAuth authentication is required with Twitter's API v1.1
这是什么原因?从我目前的研究中我发现,它与 oauth 有关。但其实我不知道,oauth是什么,怎么配置,所以可以正常使用twitteR包。
有人可以帮我解决这个问题吗?
非常感谢您的支持。
致以最诚挚的问候!!!
【问题讨论】:
-
阅读 twitteR 文档。这些示例演示了如何配置 OAuth,您需要在尝试与 twitter 交互之前执行此操作。如果您在该过程中遇到任何问题,有很多关于 SO 的问题可以解决。