mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-27 05:09:23 +01:00
Formatting changes to netcraft and gkstats.
This commit is contained in:
parent
59a803d3b2
commit
f1b02e64e5
@ -150,17 +150,19 @@ class Http(callbacks.Privmsg):
|
|||||||
(w, l, d) = self._gkrecord.search(profile).groups()
|
(w, l, d) = self._gkrecord.search(profile).groups()
|
||||||
profile = utils.htmlToText(profile)
|
profile = utils.htmlToText(profile)
|
||||||
seen = self._gkseen.search(profile).group(1)
|
seen = self._gkseen.search(profile).group(1)
|
||||||
|
if seen.startswith('0'):
|
||||||
|
seen = '%s is on gameknot right now.' % name
|
||||||
|
else:
|
||||||
|
seen = '%s was last seen on Gameknot %s.' % (name, seen)
|
||||||
if profile.find('Team:') >= 0:
|
if profile.find('Team:') >= 0:
|
||||||
team = self._gkteam.search(profile).group(1)
|
team = self._gkteam.search(profile).group(1)
|
||||||
irc.reply(msg, '%s (team: %s) is rated %s and has %s active ' \
|
irc.reply(msg, '%s (team: %s) is rated %s and has %s active ' \
|
||||||
'games and a record of W-%s, L-%s, D-%s. ' \
|
'games and a record of W-%s, L-%s, D-%s. %s' % \
|
||||||
'%s was last seen on Gameknot %s' % \
|
(name, team, rating, games, w, l, d, seen))
|
||||||
(name, team, rating, games, w, l, d, name, seen))
|
|
||||||
else:
|
else:
|
||||||
irc.reply(msg, '%s is rated %s and has %s active games ' \
|
irc.reply(msg, '%s is rated %s and has %s active games ' \
|
||||||
'and a record of W-%s, L-%s, D-%s. ' \
|
'and a record of W-%s, L-%s, D-%s. %s' % \
|
||||||
'%s was last seen on Gameknot %s' % \
|
(name, rating, games, w, l, d, seen))
|
||||||
(name, rating, games, w, l, d, name, seen))
|
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
if profile.find('User %s not found!' % name) != -1:
|
if profile.find('User %s not found!' % name) != -1:
|
||||||
irc.error(msg, 'No user %s exists.')
|
irc.error(msg, 'No user %s exists.')
|
||||||
@ -284,7 +286,7 @@ class Http(callbacks.Privmsg):
|
|||||||
s = utils.htmlToText(html, tagReplace='').strip('\xa0 ')
|
s = utils.htmlToText(html, tagReplace='').strip('\xa0 ')
|
||||||
irc.reply(msg, s[9:]) # Snip off "the site"
|
irc.reply(msg, s[9:]) # Snip off "the site"
|
||||||
elif html.find('We could not get any results') != -1:
|
elif html.find('We could not get any results') != -1:
|
||||||
irc.reply(msg, 'No results found for %s' % hostname)
|
irc.reply(msg, 'No results found for %s.' % hostname)
|
||||||
else:
|
else:
|
||||||
irc.error(msg, 'The format of the was odd.')
|
irc.error(msg, 'The format of the was odd.')
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user