Last active
August 29, 2015 14:07
-
-
Save samsondav/743d6b8e4d7c4d462bdb to your computer and use it in GitHub Desktop.
Ruby script to remove all twitter following
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' | |
client = Twitter::REST::Client.new do |config| | |
config.consumer_key = "xxx" | |
config.consumer_secret = "yyy" | |
config.access_token = "123-zzz" | |
config.access_token_secret = "www" | |
end | |
loop do | |
begin | |
friends_ids = client.friends.take(50) | |
if friends_ids.any? | |
client.unfollow(friends_ids) | |
else | |
break | |
end | |
rescue Twitter::Error::TooManyRequests | |
sleep 300 | |
retry | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It won't output anything, just leave it running.