Created
December 27, 2009 23:40
-
-
Save rubenfonseca/264450 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
require 'mq' | |
require 'twitter/json_stream' | |
username = ARGV.shift | |
password = ARGV.shift | |
raise "need username and password" if !username or !password | |
AMQP.start(:host => 'localhost') do | |
twitter = MQ.new.fanout('twitter') | |
stream = Twitter::JSONStream.connect( | |
:path => '/1/statuses/filter.json?track=iphone', | |
:auth => "#{username}:#{password}" | |
) | |
stream.each_item do |status| | |
twitter.publish(status) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment