mirror of
https://github.com/jlu5/SupyPlugins.git
synced 2025-04-26 04:51:08 -05:00
LastFM: drop depends on bs4
This commit is contained in:
parent
6d03a08fee
commit
610eab51f8
@ -4,13 +4,11 @@ supybot-lastfm (GLolol's fork)
|
||||
[](https://travis-ci.org/GLolol/supybot-lastfm)
|
||||
A plugin for Supybot that displays various information about LastFM IDs on IRC.
|
||||
|
||||
**This version of the plugin depends on Beautiful Soup 4 and lxml for parsing! (This may change in the future).**
|
||||
|
||||
### Changes made in this fork:
|
||||
|
||||
- Native Python 3 support.
|
||||
- Code cleanup (use Supybot's built in URL fetcher instead of urllib/urllib2).
|
||||
- Bug fixes.
|
||||
- Various bugfixes.
|
||||
|
||||
A full list of changes can be found [here](https://github.com/GLolol/supybot-lastfm/compare/krf:master...devel).
|
||||
|
||||
|
@ -39,7 +39,6 @@ import supybot.callbacks as callbacks
|
||||
import supybot.world as world
|
||||
import supybot.log as log
|
||||
|
||||
from bs4 import BeautifulSoup
|
||||
from xml.dom import minidom
|
||||
from time import time
|
||||
try:
|
||||
@ -134,8 +133,8 @@ class LastFM(callbacks.Plugin):
|
||||
irc.error("Unknown ID (%s) or unknown method (%s)"
|
||||
% (msg.nick, method), Raise=True)
|
||||
|
||||
soup = BeautifulSoup(f, "xml")
|
||||
content = soup.find("lfm").contents[1].find_all("name")
|
||||
xml = minidom.parse(f).getElementsByTagName("lfm")[0]
|
||||
content = xml.childNodes[1].getElementsByTagName("name")
|
||||
results = [res.string.strip() for res in content[0:maxResults*2]]
|
||||
if method in ('topalbums', 'toptracks'):
|
||||
# Annoying, hackish way of grouping artist+album/track items
|
||||
|
@ -1,3 +1 @@
|
||||
git+https://github.com/ProgVal/Limnoria.git
|
||||
beautifulsoup4
|
||||
lxml
|
||||
|
Loading…
x
Reference in New Issue
Block a user