Created
November 14, 2009 07:37
-
-
Save coderberry/234430 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 'rubygems' | |
require 'twitter' | |
require 'ruby-growl' | |
last_tweet_id = 0 | |
loop do | |
result = Twitter::Search.new('teachmetocode').since(last_tweet_id).fetch().results.first | |
if result | |
from_user = result[:from_user] | |
text = result[:text] | |
last_tweet_id = result[:id] | |
g = Growl.new "localhost", "ruby-growl", ["ruby-growl Notification"] | |
g.notify "ruby-growl Notification", from_user, text | |
else | |
puts "No results.." | |
end | |
sleep 30 | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment