Http.cyborg now uses the user's nick if non is specified

This commit is contained in:
James Vega 2004-08-16 04:48:35 +00:00
parent 176c71b6a9
commit 1a6754a307

View File

@ -208,11 +208,14 @@ class Http(callbacks.Privmsg):
_cyborgRe = re.compile(r'<p class="mediumheader">(.*?)</p>', re.I)
def cyborg(self, irc, msg, args):
"""<name>
"""[<name>]
Returns a cyborg acronym for <name> from <http://www.cyborgname.com/>.
If <name> is not specified, uses that of the user.
"""
name = privmsgs.getArgs(args)
name = privmsgs.getArgs(args, required=0, optional=1)
if not name:
name = msg.nick
name = urllib.quote(name)
url = 'http://www.cyborgname.com/cyborger.cgi?acronym=%s' % name
html = webutils.getUrl(url)