Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

TwitteR setup_twitter_oauth() failing

I was following the vignette for the package, updated and loaded all necessary packages, seemed like it would be a pretty straight-forward process to authenticate. Instead, I get an error

> setup_twitter_oauth(consumer_key, consumer_secret, access_token, access_secret)
[1] "Using direct authentication"
Error in check_twitter_oauth() : OAuth authentication error:
This most likely means that you have incorrectly called setup_twitter_oauth()'

My paraphrased and redacted program looks more-or-less like this.

library("twitteR")
download.file(url="http://curl.haxx.se/ca/cacert.pem", destfile="cacert.pem") #read this was necessary for Windows machines
consumer_key <- 'abc'
consumer_secret <- 'abc'
access_token <- '123-abc'
access_secret <- 'abc'
setup_twitter_oauth(consumer_key, consumer_secret, access_token, access_secret)

I read a lot of the other SO questions on this topic, nothing solved my issue (most of them used the old authentication process anyway). I'm trying to create a wordcloud following this tutorial.

like image 951
Tyler Beason Avatar asked Jun 30 '15 02:06

Tyler Beason


3 Answers

Just (install and) load the package 'base64enc'.

like image 127
Funkwecker Avatar answered Nov 09 '22 01:11

Funkwecker


I had to do the following settings to make this work

package versions : base64enc_0.1-3 httr_1.2.1 twitteR_1.1.8

installed twitteR using command: devtools::install_github("jrowen/twitteR", ref = "oauth_httr_1_0")

And i had an existing app which didnt work so i went ahead a created a new app on twitter.

This combination works for me

like image 42
Saurabh Singh Avatar answered Nov 09 '22 00:11

Saurabh Singh


Just check your firewall settings and allow R through.

I tried all the the different solutions mentioned regarding packages , etc. None of them worked. I finally found that it is nothing but a simple firewall issue. I recommend that everybody who faces this issue first check their firewall settings. Make sure that R is added in the list of applications allowed through the firewall. This should solve the issue.

like image 3
Brindha Nagarajan Avatar answered Nov 09 '22 01:11

Brindha Nagarajan