2012-07-30 67 views
1

我一直在嘗試使用下面的腳本通過ROAuth驗證:ROAuth握手

library("ROAuth") 
    library("RCurl") 

requestURL <- "https://api.twitter.com/oauth/request_token" 
accessURL = "https://api.twitter.com/oauth/access_token" 
authURL = "https://api.twitter.com/oauth/authorize" 


cKey<- "Key" 
cSecret<- "Secret" 


Cred <- OAuthFactory$new(consumerKey=cKey, 
      consumerSecret=cSecret, 
      requestURL=requestURL, 
      accessURL=accessURL, 
      authURL=authURL) 

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

每次我在這段代碼輸入,我得到的錯誤:

Error in Cred$handshake(cainfo = system.file("CurlSSL", "cacert.pem", : Invalid response from site, please check your consumerKey and consumerSecret and try again. 

我不知道是什麼我做錯了。我通過重新安裝ROauth和RCurl並檢查其版本信息(ROAuth 0.9.1和RCurl_1.91-1.1(?)),確保每個必需的軟件包都是最新的。安裝完成後,我重新啓動了R(作爲另一個帖子建議的可能解決方案)。我複製並複查了消費者密鑰和消費者密鑰,我相信他們是正確的。有沒有人有任何其他想法?

謝謝。

回答