Created
November 22, 2013 11:00
-
-
Save felixhummel/7598124 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
[[ $1 == 'skip' ]] || wget -c http://dir.xiph.org/yp.xml | |
python<<'EOF' | |
from lxml import etree | |
t = etree.parse(open('yp.xml')) | |
def urls_by_genre(genre): | |
xpath = """//entry[contains(genre, '{0}')]""".format(genre) | |
return [e.find('listen_url').text for e in t.xpath(xpath)] | |
print '\n'.join(urls_by_genre('smooth')) | |
EOF | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment