Created
October 20, 2009 14:39
-
-
Save kvnsmth/214286 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 '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