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

lookup_friendships stops collecting info #436

Closed
MAGALLANESJoseManuel opened this issue Jul 29, 2020 · 4 comments
Closed

lookup_friendships stops collecting info #436

MAGALLANESJoseManuel opened this issue Jul 29, 2020 · 4 comments

Comments

@MAGALLANESJoseManuel
Copy link

I am using the function lookup_friendships() with a list of more than 500 pairs of users.
It stops collecting the info after 180 pairs. I guess I need to configure the retryOnLimit somewhere.. can you please help?

@Arf9999
Copy link

Arf9999 commented Jul 30, 2020

There is no retryonratelimit option for that function call to the API.

You'll need to create your own by looping and using the rate_limit() function.

@MAGALLANESJoseManuel
Copy link
Author

There is no retryonratelimit option for that function call to the API.

You'll need to create your own by looping and using the ratelimits() function.

Do you an example on the use of ratelimits() function?

@Arf9999
Copy link

Arf9999 commented Jul 31, 2020

If you use this to control a loop:

rl <- rtweet::rate_limit( query = "lookup_friendships")

It'll give you the option to see how many requests remain until ratelimit is reached. Max is 15, Each request will surface 12 pairs. So you'll need to divide your list of accounts by (15 * 12 = 180)

It also lets you know when the rate limit will be reset, so you can pause between loops:

sys.Sleep(as.numeric(rl[1, "reset"] *60)

@hadley
Copy link
Member

hadley commented Feb 27, 2021

Now tracking in #510

@hadley hadley closed this as completed Feb 27, 2021
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

4 participants