Reputation: 27
I want to make ruby script that will print all followers for any account, but twitters API will gife me an error (too many requests) after 300 printed follower, how can i make loop to print the frist 300 then wait for 15 min then to start where its done to another 300?
Upvotes: 0
Views: 41
Reputation: 4440
you can do it like:
some_variable = 0
loop do
#**your code that puts element **
some_variable += 1
sleep(15*60) if (some_variable % 300).zero?
end
Upvotes: 1