Last active
December 17, 2015 14:09
-
-
Save bridgpal/5622869 to your computer and use it in GitHub Desktop.
Check for reservation on urbanspoon
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 '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