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

Error when retreiving users favorites with short user ids #590

Closed
simonheb opened this issue Jun 28, 2021 · 4 comments
Closed

Error when retreiving users favorites with short user ids #590

simonheb opened this issue Jun 28, 2021 · 4 comments

Comments

@simonheb
Copy link
Contributor

Problem

I'm using get_favorites to receive some users likes. It seems to randomly fail for some users. I figured these were always users with short ids. E.g.:

get_favorites("515880511",token=token)
Error: Twitter API failed [401]
 *  ()

The documentation says "User identifiers look like regular numbers, but are actually 64-bit integers which can't be stored in R's numeric vectors. For this reason, rtweet always returns ids as strings." so I am storing the id as a string.

Expected behavior

The expected behavior would be to return a set of "liked" tweets

Reproduce the problem

get_favorites("515880511",token=token)

rtweet version

‘0.7.0.9000’

@llrs
Copy link
Member

llrs commented Jun 28, 2021

Are you sure that this account does still exist and it is not blocked? Maybe the error should be handled different but if I try something similar with another service I don't get any data from Twitter and if I try with blocked users I get the same error: get_favorites("realdonaltrump") even if the webpage still exists

@simonheb
Copy link
Contributor Author

Rather sure, yes and I can access the profile.
According to https://tweeterid.com this id belongs to a screen_name: @bhs928 => 515880511

@llrs
Copy link
Member

llrs commented Jun 30, 2021

Weird, yesterday it couldn't find it, maybe I write it wrong. Anyway, the account is locked probably it is the reason you can't retrieve their favorites (and probably any other data). Will try to make the error more informative if not providing an empty data.frame with a column indicating it is locked.

@llrs
Copy link
Member

llrs commented Nov 23, 2021

I've added a custom warning and now these account will be skipped.
It should work on all functions but I haven't tested it outside get_favorites.

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

No branches or pull requests

2 participants