summaryrefslogtreecommitdiff
path: root/data/rbot/plugins/wserver.rb
diff options
context:
space:
mode:
Diffstat (limited to 'data/rbot/plugins/wserver.rb')
-rw-r--r--data/rbot/plugins/wserver.rb12
1 files changed, 4 insertions, 8 deletions
diff --git a/data/rbot/plugins/wserver.rb b/data/rbot/plugins/wserver.rb
index e1fe10bd..fb4738c1 100644
--- a/data/rbot/plugins/wserver.rb
+++ b/data/rbot/plugins/wserver.rb
@@ -6,14 +6,10 @@ class WserverPlugin < Plugin
def help(plugin, topic="")
"wserver <uri> => try and determine what webserver <uri> is using"
end
- def privmsg(m)
- unless(m.params && m.params =~ /^\S+$/)
- m.reply "incorrect usage: " + help(m.plugins)
- return
- end
+ def wserver(m, params)
redirect_count = 0
- hostname = m.params.dup
+ hostname = params[:host].dup
hostname = "http://#{hostname}" unless hostname =~ /:\/\//
begin
if(redirect_count > 3)
@@ -24,7 +20,7 @@ class WserverPlugin < Plugin
begin
uri = URI.parse(hostname)
rescue URI::InvalidURIError => err
- m.reply "#{m.params} is not a valid URI"
+ m.reply "#{hostname} is not a valid URI"
return
end
@@ -72,4 +68,4 @@ class WserverPlugin < Plugin
end
end
plugin = WserverPlugin.new
-plugin.register("wserver")
+plugin.map 'wserver :host'