Skip to content

Instantly share code, notes, and snippets.

@johngian
Created February 21, 2012 17:36
Show Gist options
  • Save johngian/1877600 to your computer and use it in GitHub Desktop.
Save johngian/1877600 to your computer and use it in GitHub Desktop.
8-bit.fm XML playlist parsing
import os
import urllib2
from xml.dom.minidom import parseString
file = urllib2.urlopen('http://dl.dropbox.com/u/1065469/8bitmusic/-playlist.xml')
data = file.read()
dom = parseString(data)
for i in dom.getElementsByTagName('path'):
out = i.toxml()
xmlData = out.replace('<path>','').replace('</path>','')
os.system("wget "+xmlData)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment