Fixed the snarfer to allow https links.

This commit is contained in:
Jeremy Fincher 2003-10-15 05:37:21 +00:00
parent b6fb71d5a5
commit bd7f1f9389
2 changed files with 8 additions and 2 deletions

View File

@ -216,7 +216,7 @@ class Sourceforge(callbacks.PrivmsgCommandAndRegexp):
_sfTitle = re.compile(r'Detail:(\d+) - ([^<]+)</title>', re.I) _sfTitle = re.compile(r'Detail:(\d+) - ([^<]+)</title>', re.I)
_linkType = re.compile(r'(\w+ \w+|\w+): Tracker Detailed View', re.I) _linkType = re.compile(r'(\w+ \w+|\w+): Tracker Detailed View', re.I)
def sourceforgeSnarfer(self, irc, msg, match): def sourceforgeSnarfer(self, irc, msg, match):
r"http://(?:www\.)?sourceforge.net/tracker/index.php\?func=detail&aid=\d+&group_id=\d+&atid=\d+" r"https?://(?:www\.)?sourceforge.net/tracker/index.php\?func=detail&aid=\d+&group_id=\d+&atid=\d+"
url = match.group(0) url = match.group(0)
fd = urllib2.urlopen(url) fd = urllib2.urlopen(url)
s = fd.read() s = fd.read()

View File

@ -37,7 +37,7 @@ class SourceforgeTest(PluginTestCase, PluginDocumentation):
plugins = ('Sourceforge',) plugins = ('Sourceforge',)
def testBugs(self): def testBugs(self):
self.assertNotError('bugs') self.assertNotError('bugs')
self.assertResponse('bugs alkjfi83hfa8', 'Can\'t find the "Bugs" link.') self.assertResponse('bugs alkjfi83fa8', 'Can\'t find the "Bugs" link.')
self.assertNotError('bugs gaim') self.assertNotError('bugs gaim')
m = self.getMsg('bugs gaim') m = self.getMsg('bugs gaim')
n = re.search('#(\d+)', m.args[1]).group(1) n = re.search('#(\d+)', m.args[1]).group(1)
@ -58,6 +58,12 @@ class SourceforgeTest(PluginTestCase, PluginDocumentation):
self.assertResponse('http://sourceforge.net/tracker/index.php?'\ self.assertResponse('http://sourceforge.net/tracker/index.php?'\
'func=detail&aid=712761&group_id=58965&atid=489450', 'func=detail&aid=712761&group_id=58965&atid=489450',
'Feature Request #712761: PyPI searching and announcements') 'Feature Request #712761: PyPI searching and announcements')
self.assertResponse('https://sourceforge.net/tracker/index.php?'\
'func=detail&aid=589953&group_id=58965&atid=489447',
'Bug #589953: Logger doesn\'t log QUITs.')
self.assertResponse('https://sourceforge.net/tracker/index.php?'\
'func=detail&aid=712761&group_id=58965&atid=489450',
'Feature Request #712761: PyPI searching and announcements')
# vim:set shiftwidth=4 tabstop=8 expandtab textwidth=78: # vim:set shiftwidth=4 tabstop=8 expandtab textwidth=78: