【发布时间】:2013-08-12 00:09:13
【问题描述】:
这个问题实际上回答了所有与 twitteR ROAuth 问题相关的问题:
TwitteR, ROAuth and Windows: register OK, but certificate verify failed
TwitteR 和 ROAuth 之前都可以在我的电脑上完美运行。但是代码块不再生成 PIN 选项。它弹出以下内容:
twitCred$handshake(cainfo="cacert.pem")
Error: Unauthorized
以前 twitCred$handshake(cainfo="cacert.pem") 指向:
To enable the connection, please direct your web browser to:
https://api.twitter.com/oauth/authorize?oauth_token=SevxcpCh9riO5PPrI8U8____
When complete, record the PIN given to you
我在 spark rstudio 服务器中尝试了我的代码。然后代码完美运行(生成输入 PIN 的选项,目前在我的电脑中没有生成)。代码是:
require(twitteR)
require(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 <- "______________"
consumerSecret <- "___________________"
twitCred <- OAuthFactory$new(consumerKey=consumerKey,
consumerSecret=consumerSecret, requestURL=requestURL, accessURL=accessURL,
authURL=authURL)
setwd("/home/__")
download.file(url="http://curl.haxx.se/ca/cacert.pem", destfile="cacert.pem")
twitCred$handshake(cainfo="cacert.pem")
To enable the connection, please direct your web browser to:
https://api.twitter.com/oauth/authorize?oauth_token=SevxcpCh9riO5PPrI8U8____
When complete, record the PIN given to you
感谢任何帮助。
【问题讨论】:
-
现在 twitCred$handshake 在我的电脑上工作。我猜 twitter 开发者网站由于过度使用而在有限的时间内阻止了该 ip。
标签: r twitter twitter-oauth roauth