Skip to content
This repository has been archived by the owner on Nov 10, 2024. It is now read-only.

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
Collaborator

hadley commented Feb 27, 2021

Now tracking in #510

@hadley hadley closed this as completed Feb 27, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants