Twitter Throws Forbidden Error After Entering Twitter API Pin

Scraping Twitter Data: API Failed (Error 403)

my_auth <- rtweet::create_token() works better but it's deprecated. But it works!

Run my_auth <- rtweet::create_token() without arguments, and you should see a login window in your browser (or confimation is you are already logged in).
In a result you should get a new variable in your environment "my_auth". Like on the image:
Sample Image

and auth file in dir (on linux): ~/.config/R/rtweet.

Then you can make query like:
obama_tweets <- rtweet::get_timeline(c("barackobama"), n = 3, parse=T, token=my_auth)


You can also use function auth_sitrep() to see which auth file is valid, because auth files created with rtweet_app() are (almost) empty (you can also check directory ~/.config/R/rtweet).

You can also reuse, saved (automatically) auth file with auth <- readRDS("~/.config/R/rtweet/default.rds").

Trying to connect to Twitter Streaming API using ROAuth, getting Error: Forbidden

I changed the https to httpses and it worked.

twitteR authorization - cannot get PIN

You accidentally put a dot instead of a slash, try this instead:

authURL <- https://api.twitter.com/oauth/authorize

And that should bring up the link to the twitter developer page to authorize your application

R TwitteR package authorization error

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

Authorization Required error when accessing Twitter API

If you are using the CRAN version of twitteR(1.1.7) try using the GitHub version (1.1.8).

The 1.1.8 version useses httr instead of ROAuth which might help
link

Download from GitHub:

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

You might get a Warning message:
Username parameter is deprecated. Please use geoffjentry/twitteR

But you should ind twitteR in your library anyway.

And then with twitteR 1.1.8

library(httr)
library(twitteR)
setup_twitter_oauth(api_key, api_secret, access_token, access_token_secret)
tweets <- searchTwitter('#bigdata', n=150)
tweets.df <- do.call(rbind, lapply(tweets, as.data.frame))
write.csv(tweets.df, "C:/...")

Hope this helps!



Related Topics



Leave a reply



Submit