-
-
Save alobato/386847 to your computer and use it in GitHub Desktop.
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 '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