Created
September 1, 2009 03:30
-
-
Save anonymous/178885 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
# assumes you've got a copy of 'who let the dogs out' in your tmp dir | |
require 'rubygems' | |
require 'rest_client' | |
$url = "http://www.brownpapertickets.com/event/72123" | |
def site_up? | |
RestClient::get($url) rescue false | |
end | |
def announce_site_is_up! | |
puts ":)" | |
`open /tmp/dogs.mp3` | |
end | |
def poll_site! | |
loop do | |
puts "checking..." | |
announce_site_is_up! if site_up? | |
sleep 60 | |
end | |
end | |
poll_site! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment