在R中使用twitteR的oauth握手错误

时间:2014-06-08 08:05:04

标签: r twitter oauth rcurl

我一直在尝试使用R

中的tweeteR软件包下载一些推文

我的oauth凭证的代码是

cred<-AuthFactory$new(consumerKey=consumerKey,
consumerSecret=consumerSecret,requestURL=reqURL,accessURL=accessURL,authURL=authURL)

当我尝试运行以下握手时

cred$handshake(cainfo=system.file("CurlSSL","cacert.pem",package="RCurl"))

我收到此错误

Error in function (type, msg, asError = TRUE)  : 
Could not resolve host: api.twitter.com; No data record of requested type

我在Windows机器上运行代码。 (我已经包含了下载cacert.pem的代码)

1 个答案:

答案 0 :(得分:4)

我为此制定了解决方案,对于代理背后的人,他们也必须在RCurl中设置代理选项(为R设置代理是不够的)。此命令有效

options( RCurlOptions = list(verbose = TRUE,proxy = "host:port"))