Skip to content

Instantly share code, notes, and snippets.

@dirk
Created May 1, 2010 23:05
Show Gist options
  • Save dirk/386740 to your computer and use it in GitHub Desktop.
Save dirk/386740 to your computer and use it in GitHub Desktop.
require 'rubygems'
require 'highline'
require 'net/http'
h = HighLine.new
count = 0
while true
body = Net::HTTP.get URI.parse('http://feeds.gawker.com/kotaku/full')
items = body.split(/(halo)|(reach)|(code)/i).length - 1
if count < items
count = items
puts h.color('New Items', :green, :bold)
system('say "New items."')
end
puts "#{items.to_s} Item(s)"
sleep(2)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment