summaryrefslogtreecommitdiff
path: root/rbot/plugins
diff options
context:
space:
mode:
authorTom Gilbert <tom@linuxbrit.co.uk>2005-03-10 12:11:17 +0000
committerTom Gilbert <tom@linuxbrit.co.uk>2005-03-10 12:11:17 +0000
commit787c3322e0c1acdccb457c47bea76f31c5747f52 (patch)
tree6dc7e8e1bb39907208c441994127e4d6e63da03c /rbot/plugins
parentbebe7f8392f3f1750bc196cb19bd4bfbda3310b6 (diff)
fix http usage, other tweaks
Diffstat (limited to 'rbot/plugins')
-rw-r--r--rbot/plugins/google.rb22
-rw-r--r--rbot/plugins/nickserv.rb8
2 files changed, 18 insertions, 12 deletions
diff --git a/rbot/plugins/google.rb b/rbot/plugins/google.rb
index 5fa466e7..2e9aacba 100644
--- a/rbot/plugins/google.rb
+++ b/rbot/plugins/google.rb
@@ -29,21 +29,21 @@ class GooglePlugin < Plugin
http = Net::HTTP.new("www.google.com", 80, proxy_host, proxy_port)
- http.start {|http|
- begin
- resp , = http.get(query)
+ begin
+ http.start {|http|
+ resp = http.get(query)
if resp.code == "302"
result = resp['location']
end
- rescue => e
- p e
- if e.response && e.response['location']
- result = e.response['location']
- else
- result = "error!"
- end
+ }
+ rescue => e
+ p e
+ if e.response && e.response['location']
+ result = e.response['location']
+ else
+ result = "error!"
end
- }
+ end
m.reply "#{m.params}: #{result}"
end
end
diff --git a/rbot/plugins/nickserv.rb b/rbot/plugins/nickserv.rb
index 6067ec3e..94c57e6d 100644
--- a/rbot/plugins/nickserv.rb
+++ b/rbot/plugins/nickserv.rb
@@ -9,7 +9,7 @@ class NickServPlugin < Plugin
when "password"
return "nickserv password <nick> <passwd>: remember the password for nick <nick> and use it to identify in future"
when "register"
- return "nickserv register [<password>]: register the current nick, choosing a random password unless <password> is supplied - current nick must not already be registered for this to work"
+ return "nickserv register [<password> [<email>]]: register the current nick, choosing a random password unless <password> is supplied - current nick must not already be registered for this to work. Also specify email if required by your services"
when "identify"
return "nickserv identify: identify with nickserv - shouldn't be needed - bot should identify with nickserv immediately on request - however this could be useful after splits or service disruptions, or when you just set the password for the current nick"
when "listnicks"
@@ -44,6 +44,12 @@ class NickServPlugin < Plugin
@bot.sendmsg "PRIVMSG", "NickServ", "REGISTER " + passwd
@registry[@bot.nick] = passwd
@bot.okay m.replyto
+ when (/^register\s*(\S*)\s*(.*)$/)
+ passwd = $1
+ email = $2
+ @bot.sendmsg "PRIVMSG", "NickServ", "REGISTER " + passwd + " " + email
+ @registry[@bot.nick] = passwd
+ @bot.okay m.replyto
when (/^register\s*(.*)\s*$/)
passwd = $1
@bot.sendmsg "PRIVMSG", "NickServ", "REGISTER " + passwd