R TwitteR package authorization error

Boxuan picture Boxuan · Sep 15, 2014 · Viewed 13.4k times · Source

I am following the latest update on twitteR homepage, and I can't pass the authorization process.

library(devtools)
install_github("twitteR", username="geoffjentry")

library(twitteR)
api_key <-  "XXXXXXXXXXXXXXXXX"
api_secret <- "XXXXXXXXXXXXXXXXX"
access_token <- "XXXXXXXXXXXXXXXXX"
access_secret <- "XXXXXXXXXXXXXXXXX"
setup_twitter_oauth(api_key, api_secret, access_token, access_secret)

This is the output I am getting back:

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

I have also tried setup_twitter_oauth(api_key, api_secret), and this is the error message:

[1] "Using browser based authentication"
Error in init_oauth1.0(endpoint, app, permission = params$permission) : 
client error: (401) Unauthorized

I don't think there are any other options in setup_twitter_oauth. Does anyone else encounter this error?

Answer

shopa picture shopa · Feb 19, 2015

set callback url to http://127.0.0.1:1410 in app settings in twitter