Skip to content

Instantly share code, notes, and snippets.

@kvnsmth
Created October 20, 2009 14:39
Show Gist options
  • Save kvnsmth/214286 to your computer and use it in GitHub Desktop.
Save kvnsmth/214286 to your computer and use it in GitHub Desktop.
require 'rubygems'
require 'growl' #visionmedia-growl
require 'nokogiri'
require 'open-uri'
while true
doc = Nokogiri::HTML(%x[curl -A 'Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10_5_8; en-us) AppleWebKit/532.0+ (KHTML, like Gecko) Version/4.0.3 Safari/531.9.2009' http://store.apple.com/us])
if doc.xpath('//img[@alt="We\'ll be back soon"]').size == 0
Growl.notify {
self.message = 'Apple Store updated!'
sticky!
}
break
end
sleep 30
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment