Skip to content

Instantly share code, notes, and snippets.

@nazt
Created April 19, 2010 16:54
Show Gist options
  • Save nazt/371282 to your computer and use it in GitHub Desktop.
Save nazt/371282 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
require 'rubygems'
require 'twitter'
config = YAML::load(open(".twitter"))
httpauth = Twitter::HTTPAuth.new(config['email'], config['password'])
base = Twitter::Base.new(httpauth)
base.followers.each do |follower|
if !follower.following
begin
base.friendship_create(follower.id, true)
rescue
puts "An error occurred: #{$!}"
end
puts "Created friendship with #{follower.screen_name}"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment