Skip to content

Instantly share code, notes, and snippets.

Created September 1, 2009 03:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save anonymous/178885 to your computer and use it in GitHub Desktop.
Save anonymous/178885 to your computer and use it in GitHub Desktop.
# 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