Created
June 1, 2016 18:33
-
-
Save tarakanbg/3831a7cad97fb622f8c6447226e6c9ff to your computer and use it in GitHub Desktop.
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 'open-uri' | |
require "nokogiri" | |
released = false | |
while !released do | |
page = Nokogiri::HTML(open("http://www.precisionmanuals.com/ProductCart/pc/viewCategories.asp?idCategory=26")) | |
price = page.css('#pcMain > div > div.pcShowProducts > div:nth-child(1) > div > div.pcShowProductInfoP > div.pcShowProductPrice > span').children.first.text[1..-1].gsub(",", "").to_f | |
if price < 120 | |
released = true | |
puts "RELEASED AT #{Time.now}" | |
else | |
puts "Waiting for release..." | |
sleep 120 | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment