Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Twitmo: Unauthorized (HTTP 401) #27

Open
agallell opened this issue Nov 10, 2023 · 0 comments
Open

Twitmo: Unauthorized (HTTP 401) #27

agallell opened this issue Nov 10, 2023 · 0 comments

Comments

@agallell
Copy link

Unfortunately it seems there are problems related to the authentication.
After running the get_tweets function I get the following error:

"Requesting token on behalf of user...
Error in twitter_init_oauth1.0(self$endpoint, self$app, permission = self$params$permission, :
Unauthorized (HTTP 401)."

In the tutorial you write "Make sure you have a regular Twitter Account before start to sample your tweets." But in the script there it is nowhere indicated how to authenticate.
Some other tutorial suggest to insert Twitter consumer key and secret using setup_twitter_oauth function, but it seems to be under a package which is no longer available.

Can you please provide guidance on how to solve the issue?
Here below the simple script I am trying to run. After that I get the error.
Thanks!

install remotes package if it's not already

if (!requireNamespace("devtools", quietly = TRUE)) {
install.packages("devtools")
}

devtools::install_version("rtweet", version = "0.7.0", repos = "http://cran.us.r-project.org")

install remotes package if it's not already

if (!requireNamespace("remotes", quietly = TRUE)) {
install.packages("remotes")
}

install dev version of Twitmo from github

remotes::install_github("abuchmueller/Twitmo")
library(Twitmo)

get_tweets(method = 'stream',
location = "GBR",
timeout = 30,
file_name = "uk_tweets.json")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant