mirror of
https://github.com/jlu5/SupyPlugins.git
synced 2025-05-02 16:31:11 -05:00
BonusLevel: distinguish between packs and levels in output
This commit is contained in:
parent
84dc5d4531
commit
3cad53b5bd
@ -56,9 +56,9 @@ class BonusLevel(callbacks.PluginRegexp):
|
||||
|
||||
def _packid(self, irc, packid):
|
||||
url = 'http://www.bonuslevel.org/games/pack_-_%s.html' % packid
|
||||
return self._fetch(irc, url)
|
||||
return self._fetch(irc, url, itemname="Pack")
|
||||
|
||||
def _fetch(self, irc, url):
|
||||
def _fetch(self, irc, url, itemname="Level"):
|
||||
self.log.debug('BonusLevel: fetching URL %s', url)
|
||||
data = utils.web.getUrl(url)
|
||||
soup = BeautifulSoup(data)
|
||||
@ -71,7 +71,7 @@ class BonusLevel(callbacks.PluginRegexp):
|
||||
gamelink = linkobj["href"].replace('..', 'http://www.bonuslevel.org')
|
||||
title = linkobj.find("span", class_="gtitle").text
|
||||
author = div.ul.find_all('li')[1].a.text.strip()
|
||||
s = format("Level %s by %s: %u", ircutils.bold(title), ircutils.bold(author), gamelink)
|
||||
s = format("%s %s by %s: %u", itemname, ircutils.bold(title), ircutils.bold(author), gamelink)
|
||||
irc.reply(s)
|
||||
|
||||
def levelSnarfer(self, irc, msg, match):
|
||||
|
Loading…
x
Reference in New Issue
Block a user