2016-12-25 105 views
0

我有一個閃亮的應用程序,收集來自Twitter的推文,並對他們做一些情感分析 我想要的是通過讓他/她登錄到Twitter的客戶端的Twitter帳戶收集推文通過我的應用程序 ,所以一旦客戶訪問我的網站,並希望對某些話題做一些情感分析,我的網站將使用客戶的Twitter帳號收集與該話題相關的推文實施使用R語言登錄Twitter

我在Twitter中通過此鏈接:https://dev.twitter.com/web/sign-in/implementing

我的R代碼:

library(httr) 
library(ROAuth) 

credentials <- OAuthFactory$new(consumerKey = "TFJVM92uscmNc7POwlG6YwsgS", 
            consumerSecret = "YnrYJ9jTxZrW4nLiHu0WrM4tvmFP3eTt6zsEKfEd9rggmpbV2e", 
            requestURL= "https://api.twitter.com/oauth/request_token", 
            accessURL= "https://api.twitter.com/oauth/request_token", 
            needsVerifier=FALSE 
           ) 
credentials$handshake(signMethod="HMAC", curl=getCurlHandle()) 
credentials$OAuthRequest("https://api.twitter.com/oauth/request_token", "POST") 

,但我得到這個錯誤:

credentials$handshake(signMethod="HMAC", curl=getCurlHandle()) 
Error in function (type, msg, asError = TRUE) : 
    SSL certificate problem, verify that the CA cert is OK. Details: 
error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed 
> credentials$OAuthRequest("https://api.twitter.com/oauth/request_token", 

"POST") Error in credentials$OAuthRequest(" https://api.twitter.com/oauth/request_token ", : This OAuth instance has not been verified

誰能幫我這個

回答

0

我有一個類似的錯誤:Error in my_oauth$OAuthRequest(URL = url, params = params, method = "GET", : This OAuth instance has not been verified。對我來說,幫助here可能對您有用。特別是,看看這部分的代碼+評論:

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

# Copy and paste the PIN number (6 digits) on the R console 
# Change current folder into a folder where you will save all your tokens 
# Now you can save oauth token for use in future sessions with R 

希望這會有所幫助。

+0

謝謝,我會考慮你的答案 – Wejdan