diff --git a/plugins/Forums.py b/plugins/Forums.py index d197b420d..5f941eaac 100644 --- a/plugins/Forums.py +++ b/plugins/Forums.py @@ -51,10 +51,20 @@ class Forums(callbacks.PrivmsgRegexp): _ggGroup = re.compile(r'Newsgroups: ]+>([^<]+)') def googlegroups(self, irc, msg, match): r"http://groups.google.com/[^\s]+" - request = urllib2.Request(match.group(0)+'&frame=off', headers=\ + request = urllib2.Request(match.group(0), headers=\ {'User-agent': 'Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 4.0)'}) fd = urllib2.urlopen(request) text = fd.read() + fd.close() + if match.group(0).find('&prev=/') >= 0: + path = re.search('view the ]+)>no',text) + url = 'http://groups.google.com' + request = urllib2.Request('%s%s' % (url,path.group(1)), + headers={'User-agent': 'Mozilla/4.0 (compatible; MSIE 5.5;' + 'Windows NT 4.0)'}) + fd = urllib2.urlopen(request) + text = fd.read() + fd.close() mThread = self._ggThread.search(text) mGroup = self._ggGroup.search(text) if mThread and mGroup: