Skip to content

Instantly share code, notes, and snippets.

@tarakanbg
Created June 1, 2016 18:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tarakanbg/3831a7cad97fb622f8c6447226e6c9ff to your computer and use it in GitHub Desktop.
Save tarakanbg/3831a7cad97fb622f8c6447226e6c9ff to your computer and use it in GitHub Desktop.
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