Skip to content

Instantly share code, notes, and snippets.

@dca
Forked from wildjcrt/check_bot.rb
Created August 6, 2013 16:42
Show Gist options
  • Select an option

  • Save dca/6166228 to your computer and use it in GitHub Desktop.

Select an option

Save dca/6166228 to your computer and use it in GitHub Desktop.
# encoding: utf-8
# $ ruby check_bot.rb
require 'open-uri'
@url = 'https://registrano.com/events/handlino-new-opening/registrations/new'
def check?
open(@url) do |f|
f.each_line do |line|
if line.include? '抱歉,目前本活動已額滿。'
puts '抱歉,目前本活動已額滿。'
return false
end
end
end
end
while(1) do
system("open #{@url}") if check?
sleep 60
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment