Created
July 1, 2009 04:43
-
-
Save penso/138586 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
#!/usr/bin/ruby | |
require 'rubygems' | |
require 'twitter' | |
users = %w/user1 user2 user3/ | |
httpauth = Twitter::HTTPAuth.new('YOUR LOGIN', 'YOUR PASS') | |
base = Twitter::Base.new(httpauth) | |
base.friends_timeline.each { |tweet| | |
if tweet.text =~ /appnotification/ | |
puts "#{tweet.user.screen_name}: #{tweet.text}" if not users.include? tweet.user.screen_name | |
end | |
} | |
# Following all friends | |
base.followers.each do |friend| | |
begin | |
base.friendship_create(friend.screen_name, true) | |
puts "Added #{friend.screen_name}" | |
rescue Twitter::General | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment