Skip to content

Instantly share code, notes, and snippets.

@eduardordm
Created December 4, 2012 17:52
Show Gist options
  • Save eduardordm/4206823 to your computer and use it in GitHub Desktop.
Save eduardordm/4206823 to your computer and use it in GitHub Desktop.
Blocks followers with no tweets (mostly fake followers)
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