0

I try to scrape tweets using the twittR packages and am receiving the following error:

Based on the output I tried everything which was outlined here: TwitteR setup_twitter_oauth() failing. However, non of its working (including: devtools::install_github("jrowen/twitteR", ref = "oauth_httr_1_0"))

When I try this alternative I get:

packages <- c("twitteR", "openssl")
### checking if packages are already installed and installing if not
for(i in packages){
  if(!(i %in% installed.packages()[, "Package"])){
    install.packages(i)
  }
library(i, character.only = TRUE) ## load packages
}

And then run:

setup_twitter_oauth(consumer_key, consumer_secret)

I get the following error:

Error in init_oauth1.0(self$endpoint, self$app, permission =  self$params$permission,  : 
Unauthorized (HTTP 401).

And I assume this has something to do with the root cause. Any thoughts on where I can get rid of this problem?

Henk Straten
  • 1,365
  • 18
  • 39
  • Use [`rtweet`](https://cran.r-project.org/web/packages/rtweet/index.html). It has a more modern interface, better default return values, handles (in many cases) rate limits and more. Plus there are many [resources](https://cran.r-project.org/web/packages/rtweet/index.html) to get you started. – hrbrmstr Feb 04 '18 at 13:50
  • @hrbrmstr also here I receive a Unautohorized HTTP 401 error. Any thoughts? – Henk Straten Feb 04 '18 at 18:40
  • you must be entering in credentials wrong or behind a very weird/invasive proxy server – hrbrmstr Feb 04 '18 at 22:37
  • i've been using rtweet for a while but out of the blue the 401 error has started showing for me too – Saleem Khan Feb 11 '18 at 00:05

0 Answers0