Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/jquery-ui/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用ROAuth在Twitter上进行身份验证时未生成PIN_R_Twitter Oauth_Roauth - Fatal编程技术网

使用ROAuth在Twitter上进行身份验证时未生成PIN

使用ROAuth在Twitter上进行身份验证时未生成PIN,r,twitter-oauth,roauth,R,Twitter Oauth,Roauth,我正在尝试使用R对Twitter进行身份验证,但无法获取PIN 我的守则如下: download.file(url="http://curl.haxx.se/ca/cacert.pem", destfile="cacert.pem") reqURL <- "http://api.twitter.com/oauth/request_token" accessURL <- "http://api.twitter.com/oauth/access_token" authURL <-

我正在尝试使用R对Twitter进行身份验证,但无法获取PIN

我的守则如下:

download.file(url="http://curl.haxx.se/ca/cacert.pem", destfile="cacert.pem")

reqURL <- "http://api.twitter.com/oauth/request_token"
accessURL <- "http://api.twitter.com/oauth/access_token"
authURL <- "http://api.twitter.com/oauth/authorize"
consumerKey <- "foo"
consumerSecret <- "bar"
twitCred <- OAuthFactory$new(consumerKey=consumerKey,
                             consumerSecret=consumerSecret,
                             requestURL=reqURL,
                             accessURL=accessURL,
                             authURL=authURL
                             )
twitCred$handshake(cainfo="cacert.pem", ssl.verifypeer=FALSE)
download.file(url=”http://curl.haxx.se/ca/cacert.pem,destfile=“cacert.pem”)

reqURL授权应用程序具有“oauth_验证程序”后从Twitter返回的url。我用这个作为R中的PIN。我能够复制并粘贴到R中它要求PIN的地方。直到我按enter键,R中才出现文本。这个别针似乎被接受了。我尝试了registerWitterOAuth(cred),返回了真实的响应。但是,我在获取搜索返回的任何信息时仍然遇到问题:

下载.file(url=”http://curl.haxx.se/ca/cacert.pem,destfile=“cacert.pem”) 选项(rcurlpoptions=list(cainfo=system.file(“curlsl”、“cacert.pem”、package=“RCurl”))

r_stats也许您需要更新您的cacert.pem文件。看看这是否有用。这个问题已经贴了很多次了,代码完全一样。当你克服这个问题时,用你所做的来回答这个问题会很有帮助,因为现在这个问题每天都会被问到一次。谢谢Simon。当我尝试按照您的建议刷新cacert.pem时,我得到了“C:\Users\V-JFOR~1\AppData\Local\Temp\Rtmp4Y79aI/cacert.pem“had status 309”。我想那是因为curl在我的机器上不能正常工作;最新的cacert.pem应该在哪里?在R工作目录中?