Skip to content

Instantly share code, notes, and snippets.

@kzaitsev
Last active January 1, 2016 15:28
Show Gist options
  • Save kzaitsev/8164009 to your computer and use it in GitHub Desktop.
Save kzaitsev/8164009 to your computer and use it in GitHub Desktop.
require 'http'
require 'colored'
require 'nokogiri'
$url = 'http://playo.ru/goods/241/#.Ur8zaWRdVmg'
$run = '/Applications/VLC.app/Contents/MacOS/VLC /Users/bugagazavr/Downloads/1.mp3'
$start_price = 695
def get
res = HTTP.get($url).response
if res.code == 200
doc = Nokogiri::HTML(res.body)
p = doc.css('div#game_main_price span').text.to_i
if p != $start_price
puts 'SWAG'.green
Kernel.exec($run)
else
puts 'NOTHING'.blue
end
else
puts 'FAILED'.red
end
end
while true do
get
sleep(30)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment