examples/growl_daemon.rb in tweetstream-1.1.0.rc1 vs examples/growl_daemon.rb in tweetstream-1.1.0.rc2
- old
+ new
@@ -2,13 +2,21 @@
require 'tweetstream'
require 'ruby-growl'
if args_start = ARGV.index('--')
username, password = ARGV[args_start + 1].split(':')
- tracks = ARGV[args_start + 2 .. -1]
+ tracks = ARGV[args_start + 2 .. -1]
puts "Starting a GrowlTweet to track: #{tracks.inspect}"
end
-TweetStream::Daemon.new(username,password).track(*tracks) do |status|
+TweetStream.configure do |config|
+ config.consumer_key = 'abcdefghijklmnopqrstuvwxyz'
+ config.consumer_secret = '0123456789'
+ config.oauth_token = 'abcdefghijklmnopqrstuvwxyz'
+ config.oauth_token_secret = '0123456789'
+ config.auth_method = :oauth
+end
+
+TweetStream::Daemon.new('tracker').track(*tracks) do |status|
g = Growl.new 'localhost', 'growltweet', ['tweet']
g.notify 'tweet', status.user.screen_name, status.text
end