Created
January 27, 2010 05:05
-
-
Save baroquebobcat/287557 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 '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