Created
December 17, 2014 00:41
-
-
Save inky/9037320ae82624b01004 to your computer and use it in GitHub Desktop.
Unfollow everyone. (for twitter_ebooks v2.x)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bot.scheduler.every '1h', :first_in => '1s' do | |
bot.log "Start unfollowing" | |
bot.twitter.friend_ids.each do |friend_id| | |
bot.log "Will unfollow ##{friend_id}" | |
begin | |
bot.twitter.unfollow(user_id=friend_id) | |
rescue Twitter::Error::TooManyRequests => error | |
bot.log "Rate limit exceeded; will stop unfollowing for now" | |
return | |
rescue Exception => error | |
bot.log "Error while unfollowing: #{error}" | |
end | |
sleep 1 | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment