require 'twitter'
auth = Twitter::HTTPAuth.new('twitter_username', 'password')
base = Twitter::Base.new(auth)
guilty = base.friend_ids - base.follower_ids
puts "There are #{guilty.size} People you follow who do not follow you"
guilty.each do |user_id|
user = base.friendship_destroy([user_id])
puts "#{user.id} not following anymore"
end
Orginal code only lists people which are not following you. http://blog.jerodsanto.net/2009/05/see-which-twitterers-dont-follow-youback-in-less-than-15-lines-of-ruby/#more-292
I changed the code a little and now it can be used for mass unfollow in twitter. Use responsibly, don’t forget you’re limitted by the api limit. I’m not sure but a user can make 150 requests from the api in a hour. This means you can unfollow 150 people in a hour.
How to Run the Code
Ubuntu users can run the code easily. Open a terminal and copy paste the codes.
sudo gem install twitter
After the installation process, copy the ruby code to a text editor which is given above. (Don’t forget to change the username and password)
Then save the file as unfollow.rb and run the code in terminal.
irb unfollow.rb
Discussion
No comments yet.