Rate Limits for Follow/Unfollow

7 views
Skip to first unread message

Cori

unread,
May 29, 2018, 10:51:54 AM5/29/18
to twitter-...@googlegroups.com
Hey guys,

I've noticed recently I'm only able to follow 3-4 people before hitting my rate limit. Doesn't matter how long I wait after the timeout is expired. Today I shut the bot down and it was a good 8 hours before I ran it again with still the same result.

Any ideas appreciated.

I'm using the latest gem.

Thanks!

Essentially I'm doing this:

begin

  (Client.follower_ids.to_a - Client.friend_ids.to_a).each do |user_id|

  [...]


  if (EXCEPTIONS_LIST.include? user_name)

        my_log_action = "#{MY_OWNER}:#{MY_SCREEN_NAME}:Follaback:User #{user_name}(# {user_id}) found in exceptions list. Skipping."

        logAction(my_log_action)

        next

      end

      Client.follow(user_id)


rescue Twitter::Error::TooManyRequests => error

       puts error

       p 'We exceeded our rate limit, sleeping for ' + error.rate_limit.reset_in.to_s + ' seconds before retrying.'

       sleep error.rate_limit.reset_in

       exit



Reply all
Reply to author
Forward
0 new messages