推特和 ROAuth [英] twitteR and ROAuth
问题描述
我目前正在尝试从 R 发送推文,但我无法解决以下错误:
I am currently trying to send tweets from R, but I cannot get around the following error:
Error in .self$twFromJSON(out) :
Error: Could not authenticate with OAuth.
我已按照 twitteR 小插图中的说明以及与此相关的其他 stackoverflow 问题 (http://stackoverflow.com/questions/8122879/roauth-on-windows-using-r) 进行操作,但似乎没有人绕过这个错误.这是我正在使用的代码:
I have followed the directions in the twitteR vignette and the other stackoverflow questions concerning the matter (http://stackoverflow.com/questions/8122879/roauth-on-windows-using-r), but none seem to get around this error. Here is the code I am using:
library("twitteR")
library('ROAuth')
requestURL <- "https://api.twitter.com/oauth/request_token"
accessURL = "http://api.twitter.com/oauth/access_token"
authURL = "http://api.twitter.com/oauth/authorize"
consumerKey = "*****************************"
consumerSecret = "************************"
Cred <- OAuthFactory$new(consumerKey=consumerKey,
consumerSecret=consumerSecret,
requestURL=requestURL,
accessURL=accessURL,
authURL=authURL)
Cred$handshake(cainfo = system.file("CurlSSL", "cacert.pem", package = "RCurl"))
registerTwitterOAuth(Cred)
通过这里工作.registerTwitterOAuth 返回 TRUE,因此您会认为一切正常.但是当我尝试发送推文时,我收到了上面列出的错误.
Through here works. registerTwitterOAuth returns TRUE, so you would think that everything worked. But when I try and send a tweet, I get the error listed above.
我正在尝试通过以下方式发送推文:
I'm trying to send a tweet by doing:
tweet("text to tweet")
结果:
Error in .self$twFromJSON(out) :
Error: Could not authenticate with OAuth.
不知道出了什么问题.OAuth 验证似乎有效,但随后我无法发送推文.
Not sure what's going wrong. The OAuth validation seems to work, but then I am unable to send tweets.
推荐答案
这个希望解决了我昨天刚刚上传的版本.如果您尚未使用 0.9.1 版本的 ROAuth,能否更新您的软件包并重试?
This hopefully was resolved with the version that I just uploaded yesterday. If you're not already using 0.9.1 version of ROAuth, can you update your package and try again?
这篇关于推特和 ROAuth的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!