I'm running R Studio on an AWS "Ubuntu Server 12.04.2 LTS" and accessing R Studio via my browser.
When I try to authenticate at the Twitter API using the package ROAuth
with the code:
credential<-OAuthFactory$new(consumerKey="xxxxx",
consumerSecret="xxxxx",
requestURL="https://api.twitter.com/oauth/request_token",
accessURL="https://api.twitter.com/oauth/access_token",
authURL="https://api.twitter.com/oauth/authorize")
credential$handshake()
registerTwitterOAuth(credential)
I get an error after registerTwitterOAuth(credential)
saying
Error in registerTwitterOAuth(credential) :
ROAuth is no longer used in favor of httr, please see ?setup_twitter_oauth
However I can't find any further explanation..
Here is the R script that worked for me:
I´m having some issues using the setup_twitter_oauth function. I run the following code and don´t get an object after the setup_twitter_oauth function is run or the credentials file loaded.
Then i just load the cred_1.RData file and i get a sig objetc that doesn´t seem to be useful.
I´m on windows and installed the github version of the package.
Apparently the twitteR package was changed right before I posted this, so the new way to authenticate is
see https://github.com/geoffjentry/twitteR
I had some issues with
setup_twitter_oauth()
function. I ran the following code and it worked for me without any error.EDIT:
Just now sorted the issues I had with my app's access_token, now
setup_twitter_oauth
function is working perfectly.Try the below code for Twitter authentication with R, if your
api_key
,api_secret
,acsess_token
,access_token_secret
are generated without errors.The following worked for me: