mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-02-16 21:50:41 +01:00
Added team and "last seen" info in gkstats
This commit is contained in:
parent
b8189d55ce
commit
d91b9e95ef
@ -144,7 +144,9 @@ class Http(callbacks.Privmsg):
|
||||
|
||||
_gkrating = re.compile(r'<font color="#FFFF33">(\d+)</font>')
|
||||
_gkgames = re.compile(r's: </td><td class=sml>(\d+)</td></tr>')
|
||||
_gkrecord = re.compile(r'percentile(\d+), .*?%(\d+), .*?%(\d+)')
|
||||
_gkrecord = re.compile(r'percentile(\d+), [^%]+%(\d+), [^%]+%(\d+)')
|
||||
_gkteam = re.compile('Team:([^\s]+)')
|
||||
_gkseen = re.compile('seen on GK: ([^\n]+)')
|
||||
def gkstats(self, irc, msg, args):
|
||||
"<name>"
|
||||
name = privmsgs.getArgs(args)
|
||||
@ -156,9 +158,13 @@ class Http(callbacks.Privmsg):
|
||||
rating = self._gkrating.search(profile).group(1)
|
||||
games = self._gkgames.search(profile).group(1)
|
||||
profile = stripHtml(profile)
|
||||
team = self._gkteam.search(profile).group(1)
|
||||
seen = self._gkseen.search(profile).group(1)
|
||||
(w, l, d) = self._gkrecord.search(profile).groups()
|
||||
irc.reply(msg, '%s is rated %s and has %s active games; '
|
||||
'W-%s, L-%s, D-%s' % (name, rating, games, w, l, d))
|
||||
irc.reply(msg, '%s (team %s) is rated %s and has %s active games '
|
||||
'and a record of W-%s, L-%s, D-%s. ' \
|
||||
'%s was last seen on Gameknot %s' % \
|
||||
(name, team, rating, games, w, l, d, name, seen))
|
||||
except AttributeError:
|
||||
if profile.find('User %s not found!' % name) != -1:
|
||||
irc.error(msg, 'No user %s exists.')
|
||||
|
Loading…
x
Reference in New Issue
Block a user