Skip to content

Instantly share code, notes, and snippets.

@jdennes
Created December 20, 2010 23:47
Show Gist options
  • Save jdennes/749241 to your computer and use it in GitHub Desktop.
Save jdennes/749241 to your computer and use it in GitHub Desktop.
Automatically download the http://www.ivyleague.com.au/ playlist
# Automatically download the http://www.ivyleague.com.au/ playlist
require 'rexml/document'
`wget http://www.ivyleague.com.au/medias/audioplayer/data.xml`
file = File.open('data.xml', 'r')
doc = REXML::Document.new(file.read)
files = []
doc.elements.each('songs/song') do |s|
files << "http://www.ivyleague.com.au#{s.attributes["url"]}"
end
files.each do |f|
`wget "#{f}"`
end
@atnan
Copy link

atnan commented Dec 21, 2010

Or perhaps:

$ curl -s http://www.ivyleague.com.au/medias/audioplayer/data.xml | \
  perl -ne '/<song artist="[^"]+" url="([^"]+)"/ && print "\"http://www.ivyleague.com.au$1\"\n"' | \
  xargs wget

@jdennes
Copy link
Author

jdennes commented Dec 21, 2010

Nice one. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment