我已经使用以下代码库(RCurl)库(twitteR)库(streamR)库(ROAuth)拉推特大约一个月了
requestURL<-"https://api.twitter.com/oauth/request_token"
accessURL <- "https://api.twitter.com/oauth/access_token"
authURL ="https://api.twitter.com/oauth/authorize"
consumerkey= "my key"
consumersecret = "my secret"
cred <-OAuthFactory$new(consumerKey=consumerkey,consumerSecret=consumersecret,requestURL=requestURL,accessURL=accessURL,authURL=authURL)
cred$handshake (cainfo=system.file("CurlSSL","cacert.pem",package ="RCurl"))
通常这是可行的,但有时我会点击指向 pin 的超链接,粘贴 pin 并获得 [1] 作为回报。无论我写什么,我都会不断得到 [1]。然后,当我尝试提交请求时,我被告知它需要 OAuth(如下)。我究竟做错了什么?非常感谢您的帮助!
Error in twInterfaceObj$doAPICall(cmd, params, "GET", ...) :
OAuth authentication is required with Twitter's API v1.1