Skip to content

Instantly share code, notes, and snippets.

@bridgpal
Last active December 17, 2015 14:09
Show Gist options
  • Save bridgpal/5622869 to your computer and use it in GitHub Desktop.
Save bridgpal/5622869 to your computer and use it in GitHub Desktop.
Check for reservation on urbanspoon
require 'nokogiri'
require 'open-uri'
url = "http://rez.urbanspoon.com/reservation/start/2086"
while true
d = Nokogiri::HTML(open(url))
text = d.css("div p").first.text.gsub("this restaurant", "State Bird Provisions")
#puts text
if !text.include? "Unfortunately"
puts text
system("open http://rez.urbanspoon.com/reservation/start/2086")
end
sleep(10)
end
#Online reservations through Urbanspoon are free and instantly confirmed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment