summaryrefslogtreecommitdiff
path: root/data/rbot/plugins/httpd.rb.disabled
diff options
context:
space:
mode:
Diffstat (limited to 'data/rbot/plugins/httpd.rb.disabled')
-rw-r--r--data/rbot/plugins/httpd.rb.disabled35
1 files changed, 35 insertions, 0 deletions
diff --git a/data/rbot/plugins/httpd.rb.disabled b/data/rbot/plugins/httpd.rb.disabled
new file mode 100644
index 00000000..92fe3a80
--- /dev/null
+++ b/data/rbot/plugins/httpd.rb.disabled
@@ -0,0 +1,35 @@
+require 'webrick'
+
+class HttpPlugin < Plugin
+ include WEBrick
+
+
+ def initialize
+ super
+ @http_server = HTTPServer.new(
+ :Port => 5555
+ )
+ @http_server.mount_proc("/") { |req, resp|
+ resp['content-type'] = 'text/html'
+ resp.body = "<html><head><title>rbot httpd plugin</title></head><body>"
+ resp.body += "#{@bot.status} <br />"
+ resp.body += "hello from rbot."
+ resp.body += "</body>"
+ raise HTTPStatus::OK
+ }
+ Thread.new {
+ @http_server.start
+ }
+ end
+ def cleanup
+ @http_server.shutdown
+ end
+ def help(plugin, topic="")
+ "no help yet"
+ end
+ def privmsg(m)
+ end
+end
+
+plugin = HttpPlugin.new
+plugin.register("http")