summaryrefslogtreecommitdiff
path: root/data/rbot/plugins/wserver.rb
diff options
context:
space:
mode:
authorTom Gilbert <tom@linuxbrit.co.uk>2005-07-29 13:44:33 +0000
committerTom Gilbert <tom@linuxbrit.co.uk>2005-07-29 13:44:33 +0000
commit676dd61e6b0bea5f506d064039a685944aefd6fb (patch)
tree60fa1936a11a67d6412f9db28532d623aabed5d1 /data/rbot/plugins/wserver.rb
parent438d56ceb82755961229d222d82a1c22ce04ab1d (diff)
Fri Jul 29 13:07:56 BST 2005 Tom Gilbert <tom@linuxbrit.co.uk>
* Moved some stuff out of util.rb into the plugins that actually need them. Those methods didn't belong in util as they were plugin-specific. * moved a few more plugins to use map() where appropriate * made the url plugin only store unique urls
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'