Skip to content

Instantly share code, notes, and snippets.

@tganzarolli
Created March 30, 2010 02:09
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tganzarolli/348680 to your computer and use it in GitHub Desktop.
Save tganzarolli/348680 to your computer and use it in GitHub Desktop.
require 'rubygems'
require 'twitter'
require 'open-uri'
require 'yajl'
def auto_follow
twitter_config = ConfigStore.new("config/twitter_credentials.yml")
shortening_config = ConfigStore.new("config/url_shortening.yml")
httpauth = Twitter::HTTPAuth.new(twitter_config['email'], twitter_config['password'])
base = Twitter::Base.new(httpauth)
#Autofollow
follower_ids = base.follower_ids
friends_ids = base.friend_ids
users_to_follow = follower_ids - friends_ids
users_to_follow.each do |id|
base.friendship_create(id,true)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment