Skip to content

Instantly share code, notes, and snippets.

@coderberry
Created November 14, 2009 07:37
Show Gist options
  • Save coderberry/234430 to your computer and use it in GitHub Desktop.
Save coderberry/234430 to your computer and use it in GitHub Desktop.
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