I am trying to use the ruby gem Twitter (https://github.com/sferik/twitter) to fetch the followers of a user from twitter api.
As per the documentation (https://dev.twitter.com/docs/api/1/get/followers/ids), twitter returns 5000 users in one request. As per the rate limit settings twitter allows me to make 15 calls per 15 minutes (https://dev.twitter.com/docs/rate-limiting/1.1/limits)
Problem:
When I retrieve followers of a user with more than 75000 followers (5000*15) I get a 'Rate limit exceeded' error.
When I user the gem method Twitter.followers_id(user), I get all the followers automagically and not in buckets of 5000 with cursor. I guess the gem takes care of this internally, and hence I am unable to control or delay these requests.
In the gem documentation there is an example of rate limiting (https://github.com/sferik/twitter#rate-limiting), but I dont know if that takes care of the already retrieved users or again starts from fresh.
My question is How and when do I apply a throttling mechanism to this to get all the followers?
Regards