Skip to content

Instantly share code, notes, and snippets.

@samsondav
Last active August 29, 2015 14:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save samsondav/743d6b8e4d7c4d462bdb to your computer and use it in GitHub Desktop.
Save samsondav/743d6b8e4d7c4d462bdb to your computer and use it in GitHub Desktop.
Ruby script to remove all twitter following
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
@samsondav
Copy link
Author

It won't output anything, just leave it running.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment