From ced5e6b052bdaf30cd0ad287e0b7dee007748e89 Mon Sep 17 00:00:00 2001 From: Jeremy Fincher Date: Thu, 13 Mar 2003 07:55:49 +0000 Subject: [PATCH] Fixed gameknot.com URL snarfer formatting --- plugins/Forums.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/Forums.py b/plugins/Forums.py index 9f2dc5a06..fea78bd21 100644 --- a/plugins/Forums.py +++ b/plugins/Forums.py @@ -34,13 +34,15 @@ class Forums(callbacks.PrivmsgRegexp): gkPlayer = re.compile(r"popd\('(Rating[^']+)'\).*?>([^<]+)<") def gameknot(self, irc, msg, match): - r"http://gameknot.com/chess.pl\?bd=\d+&r=\d+" + r"http://(?:www\.)?gameknot.com/chess.pl\?bd=\d+&r=\d+" fd = urllib2.urlopen(match.group(0)) s = fd.read() try: ((wRating, wName), (bRating, bName)) = self.gkPlayer.findall(s) wRating = wRating.replace('
', ' ') bRating = bRating.replace('
', ' ') + wRating = wRating.replace('Wins', '; Wins') + bRating = bRating.replace('Wins', '; Wins ') irc.queueMsg(ircmsgs.privmsg(msg.args[0], '%s (%s) vs. %s (%s)' % (wName, wRating, bName, bRating)))