remind plugin: fix for repeated reminders failing after [717].
[rbot] / data / rbot / plugins / httpd.rb.disabled
1 require 'webrick'
2
3 class HttpPlugin < Plugin
4   include WEBrick
5
6
7   def initialize
8     super
9     @http_server = HTTPServer.new(
10       :Port => 5555
11     )
12     @http_server.mount_proc("/") { |req, resp|
13       resp['content-type'] = 'text/html'
14       resp.body = "<html><head><title>rbot httpd plugin</title></head><body>"
15       resp.body += "#{@bot.status} <br />"
16       resp.body += "hello from rbot."
17       resp.body += "</body>"
18       raise HTTPStatus::OK
19     }
20     Thread.new {
21       @http_server.start
22     }
23   end
24   def cleanup
25     @http_server.shutdown
26   end
27   def help(plugin, topic="")
28     "no help yet"
29   end
30   def privmsg(m)
31   end
32 end
33
34 plugin = HttpPlugin.new
35 plugin.register("http")