Skip to content

Instantly share code, notes, and snippets.

@baroquebobcat
Created January 27, 2010 05:05
Show Gist options
  • Select an option

  • Save baroquebobcat/287557 to your computer and use it in GitHub Desktop.

Select an option

Save baroquebobcat/287557 to your computer and use it in GitHub Desktop.
require 'rubygems'
require 'yaml'
require 'json'
require 'rest_client'
@config = YAML.load_file 'twitter_login.yml'
#twitter_login.yml looks like
#:user: username
#:password: password
@twitter = RestClient::Resource.new('http://twitter.com',@config)
@twitter_api = RestClient::Resource.new('http://api.twitter.com',@config)
def list_members user,list
JSON.parse(@twitter_api["1/#{user}/#{list}/members.json"].get)['users']
end
list_members(<owner of list goes here>,<name of list goes here>).each do |member|
@twitter["friendships/create/#{member['id']}.json"].post ''
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment