From 84bff2f7554e227f6a20008c898624c275dafb79 Mon Sep 17 00:00:00 2001 From: James Vega Date: Wed, 5 Nov 2003 19:45:55 +0000 Subject: [PATCH] @tiny should be specifying cmd=True when I call _getTinyUrl. That was the whole point of having a cmd parameter. --- plugins/URL.py | 25 ++----------------------- 1 file changed, 2 insertions(+), 23 deletions(-) diff --git a/plugins/URL.py b/plugins/URL.py index 405bc442a..6ff4c23b9 100644 --- a/plugins/URL.py +++ b/plugins/URL.py @@ -53,27 +53,6 @@ import ircmsgs import privmsgs import callbacks -example = utils.wrapLines(""" - lasturl, numurls, randomurl - @numurls - Error: Command must be sent in a channel or include a channel in its arguments. - (each channel has its own URL database, so these commands need to know which channel database to access) - @numurls #sourcereview - I have 93 URLs in my database. - @randomurl #sourcereview - (added by Strike at 06:25 PM, August 17, 2003) - @lasturl - Error: Command must be sent in a channel or include a channel in its arguments. - @lasturl #sourcereview - , added by Strike at 12:12 AM, August 26, 2003. - @lasturl #sourcereview --proto ftp - , added by Strike|work at 07:27 PM, August 21, 2003. - @lasturl #sourcereview --near Stuka - , added by jemfinch at 03:16 PM, August 25, 2003. - @lasturl #sourcereview --at coderforums.com - , added by Strike|work at 02:41 PM, August 25, 2003. -""") - def configure(onStart, afterConnect, advanced): # This will be called by setup.py to configure this module. onStart and # afterConnect are both lists. Append to onStart the commands you would @@ -117,7 +96,7 @@ class URL(callbacks.Privmsg, plugins.Toggleable, plugins.ChannelDBHandler): db.commit() return db - _urlRe = re.compile(r"([^\[<(\s]+://[^\])>\s]+)", re.I) + _urlRe = re.compile(r"([-a-z0-9+.]+://[-\w=#!*()',$;&/@:%?.~]+)", re.I) def doPrivmsg(self, irc, msg): channel = msg.args[0] db = self.getDb(channel) @@ -216,7 +195,7 @@ class URL(callbacks.Privmsg, plugins.Toggleable, plugins.ChannelDBHandler): if self.toggles.get('tinysnarf', channel=msg.args[0]) and\ self.toggles.get('tinyreply', channel=msg.args[0]): return - url = self._getTinyUrl(url) + url = self._getTinyUrl(url, cmd=True) if not url: irc.error(msg, 'Could not parse the TinyURL.com results page. '\ '(%s)' % conf.replyPossibleBug)