2014-03-05 63 views
2

尝试通过R(TwitteR)访问Twitter应用程序时,我无法获得PIN码。当它向我提供URL并要求输入PIN码时,该URL只会指向我的网站(在Chrome中)。在Safari和Firefox中,该网站显示“SSL是必需的”。我在控制台中没有任何错误消息;然而,我不知道在哪里得到PIN(我已经搜遍了)。感谢任何帮助。TwitteR无法获取密码

从我所知道的,我已经正确设置了Twitter应用程序中的所有设置。

download.file(url="http://curl.haxx.se/ca/cacert.pem", destfile="cacert.pem") 
    library(RCurl) 
    # Set SSL certs globally (I tried this after it didn't work without it) 
    options(RCurlOptions = list(cainfo = system.file("CurlSSL", "cacert.pem", package = "RCurl"))) 

    reqURL <- "https://api.twitter.com/oauth/request_token" 
    accessURL <- "http://api.twitter.com/oauth/access_token" 
    authURL <- "http://api.twitter.com/oauth/authorize" 
    consumerKey <- "xxxxxxxxxxxxxx" 
    consumerSecret <- "xxxxxxxxxxxxxxxx" 
    twitCred <- OAuthFactory$new(consumerKey=consumerKey, 
         consumerSecret=consumerSecret, 
         requestURL=reqURL, 
         accessURL=accessURL, 
         authURL=authURL) 
    twitCred$handshake(cainfo = system.file("CurlSSL", "cacert.pem", package = "RCurl")) 
+0

同样的问题在这里。你修好了吗? – ianaz

回答

0

您需要将握手返回的链接协议改为https(默认为http)。