Skip to content

Instantly share code, notes, and snippets.

@bobpace
Created April 27, 2013 17:39
Show Gist options
  • Save bobpace/5473916 to your computer and use it in GitHub Desktop.
Save bobpace/5473916 to your computer and use it in GitHub Desktop.
Script to check blizzcon ticket site until tickets are available.
#!/bin/ruby
require 'open-uri'
url = "http://us.blizzard.com/store/blizzcon-tickets.xml"
ticketsAvailable = false
begin
contents = open(url).read
unless contents =~ /Currently unavailable/
`start #{url}`
ticketsAvailable = true
end
puts "Checking... ticketsAvailable? #{ticketsAvailable}"
sleep(0.5)
end while (!ticketsAvailable)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment