Skip to content

Instantly share code, notes, and snippets.

@johnd
Created August 22, 2011 17:09
Show Gist options
  • Save johnd/1162923 to your computer and use it in GitHub Desktop.
Save johnd/1162923 to your computer and use it in GitHub Desktop.
Cheesy script for stalking cheap obsolete internet tablets.
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
@johnd
Copy link
Author

johnd commented Aug 22, 2011

Not that it mattered anyway, they went out of stock in about 14 seconds.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment