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.
I followed twitteR quiz directions and other stackoverflow related questions on this (http://stackoverflow.com/questions/8122879/roauth-on-windows-using-r), but no one seems to get around this error . Here is the code I'm 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)
It works here. registerTwitterOAuth returns TRUE, so you think everything worked. But when I try to send a tweet, I get the error mentioned above.
I am trying to send a tweeter by doing:
tweet("text to tweet")
This leads to:
Error in .self$twFromJSON(out) : Error: Could not authenticate with OAuth.
Not sure what will go wrong. OAuth validation seems to work, but then I can not send tweets.
source share