diff --git a/plugins/URL.py b/plugins/URL.py index fee17c8e2..862bed05e 100644 --- a/plugins/URL.py +++ b/plugins/URL.py @@ -101,7 +101,7 @@ class URL(callbacks.Privmsg, plugins.Configurable, plugins.ChannelDBHandler): db.commit() return db - _urlRe = re.compile(r"([^\[<(\s]+://[^\])>\s]+)", re.I) + _urlRe = re.compile(r"(\w+://[^\])>\s]+)", re.I) def doPrivmsg(self, irc, msg): channel = msg.args[0] db = self.getDb(channel) @@ -153,6 +153,7 @@ class URL(callbacks.Privmsg, plugins.Configurable, plugins.ChannelDBHandler): _tinyRe = re.compile(r'(http://tinyurl.com/\w{4})') def _getTinyUrl(self, url, cmd=False): try: + #debug.printf('Trying to get tinyurl for %r' % url) fd = urllib2.urlopen('http://tinyurl.com/create.php?url=%s' % url) s = fd.read() fd.close() diff --git a/test/test_URL.py b/test/test_URL.py index 046407a3f..de498fcb7 100644 --- a/test/test_URL.py +++ b/test/test_URL.py @@ -109,13 +109,7 @@ if sqlite is not None: self.assertRegexp('url tiny http://sourceforge.net/tracker/?' 'func=add&group_id=58965&atid=489447', r'http://tinyurl.com/rqac') - self.assertRegexp('url tiny http://sourceforge.net/tracker/?' - 'func=add&group_id=58965&atid=489447', - r'http://tinyurl.com/rqac') - - class URLTestCase2(ChannelPluginTestCase, PluginDocumentation): - plugins = ('URL',) def testTinysnarf(self): self.assertNotError('url config tinyurlsnarfer on') self.assertRegexp('http://www.urbandictionary.com/define.php?'