Skip to content

Instantly share code, notes, and snippets.

@gongo
Created January 26, 2010 05:16
Show Gist options
  • Save gongo/286571 to your computer and use it in GitHub Desktop.
Save gongo/286571 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
# -*- coding: utf-8 -*-
require 'rubygems'
require 'open-uri'
require 'nokogiri'
uri = <<URI
http://www.buffalo-direct.com/directshop/products/detail.php?product_id=8097
URI
ret = "Yet..."
(Nokogiri::HTML(open(uri).read)/'div.add2cart/form/div.attention').each do |m|
if m.text.empty? || m.text != "申し訳ございません、在庫がなくなりました。"
ret = "Go!!"
end
end
puts ret
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment