Created
December 4, 2012 17:52
-
-
Save eduardordm/4206823 to your computer and use it in GitHub Desktop.
Blocks followers with no tweets (mostly fake followers)
This file contains 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
require 'twitter' | |
Twitter.configure do |config| | |
config.consumer_key = 'trololol' | |
config.consumer_secret = 'trololol' | |
config.oauth_token = 'trololol-trololol' | |
config.oauth_token_secret = 'trololol' | |
end | |
begin | |
Twitter.follower_ids.each do |follower_id| | |
Twitter.block(follower_id) if Twitter.user(follower_id).tweet_count == 0 | |
end | |
rescue Twitter::Error::TooManyRequests => error | |
sleep error.rate_limit.reset_in | |
retry | |
rescue Twitter:Error::ServiceUnavailable | |
sleep 5 | |
retry | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment