class CheckPagePlugin < Plugin URL_CHECKED = "http://www.example.com" # URL of the page you want to check CHANNEL_NAME = '#yourchannel' # name of the channel to announce to CHECK_EVERY = 900 # number of seconds to check (15 minutes is default) MESSAGE = "Page updated!" # message displayed before the URL when the announcement is made def help(plugin, topic="") return "Checks #{URL_CHECKED} regularly and tells the channel when its updated." end def initialize super @last_update = @bot.httputil.get(URL_CHECKED) @bot.timer.add(CHECK_EVERY) { check_page } end def check_page html = @bot.httputil.get(URL_CHECKED) if html != @last_update @bot.say CHANNEL_NAME, "#{MESSAGE} #{URL_CHECKED}" @last_update = html end end end plugin = CheckPagePlugin.new