Skip to content

Instantly share code, notes, and snippets.

@alobato
Forked from dcrec1/gist:141121
Created May 2, 2010 02:53
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 alobato/386847 to your computer and use it in GitHub Desktop.
Save alobato/386847 to your computer and use it in GitHub Desktop.
require 'rubygems'
require 'twitter'
auth = Twitter::HTTPAuth.new 'planeta_spfc', 'xxxxxxxxxxx'
base = Twitter::Base.new auth
base.followers.select { |f| !f.following }.each do |f|
begin
base.friendship_create f.id
rescue
end
end
def base.friendship_show(id)
perform_get("/friendships/show.json", :query => {:target_id => id})
end
base.friend_ids.each do |id|
if base.friendship_show(id).relationship.target.following
sleep 24
else
base.friendship_destroy id
puts "destroyed id #{id}"
sleep 48
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment