Created
August 22, 2011 17:09
-
-
Save johnd/1162923 to your computer and use it in GitHub Desktop.
Cheesy script for stalking cheap obsolete internet tablets.
This file contains hidden or 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 'rubygems' | |
require 'nokogiri' | |
require 'open-uri' | |
URL = "http://www.dixons.co.uk/gbuk/r/touchpad/0_0_0/" | |
SELECTOR = ".prd-amount strong" | |
TARGET_PRICE = "89" | |
EXISTING_PRICE = "349.99" | |
while true | |
doc = Nokogiri::HTML(open(URL)) | |
print "." | |
prices = doc.css(SELECTOR) | |
prices.each do |price| | |
if price.text.match('89.99') | |
puts "BUY BUY BUY!" | |
`say "BUY BUY BUY"` | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Not that it mattered anyway, they went out of stock in about 14 seconds.