// Arşivler

ruby

This tag is associated with 2 posts

Fresh Start in Twitter (Script)

Delete your all friends in twitter.

If you tried to get more followers by following some marketers, makemoney, ebook salers, entrepreneurs, get traffic acounts. You probably messed your twitter acount. (Getting to many tweets, direct messages, replys, retweets.) For a fresh start up in twitter, you can get rid of all of them by this simple script.

Caution: All your following list will be deleted.

require 'rubygems'
require 'twitter'

auth = Twitter::HTTPAuth.new('username', 'password')
base   = Twitter::Base.new(auth)
sil_bastan = base.friend_ids

puts "There are #{sil_bastan.size} People you follow"

sil_bastan.each do |user_id|
user = base.friendship_destroy([user_id])
puts  "#{user.id} not following anymore"
end

Twitter Ruby UnFollow Code

require 'rubygems'
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