Anonymous (owner)

Revisions

  • 46805d Fri Aug 07 02:03:19 -0700 2009
  • 263a1e Thu Aug 06 18:56:06 -0700 2009
gist: 163668 Download_button fork
public
Public Clone URL: git://gist.github.com/163668.git
Embed All Files: show embed
Java #
1
2
3
4
5
6
7
8
9
10
11
import groovy.util.XmlParser
args.each{ id ->
def songs = new XmlParser().parse("http://www.goear.com/files/xmlfiles/${id[0]}/secm${id}.xml")
def song = songs.song[0]
def mp3 = song.'@path'
def name = (song.'@artist'+"_"+song.'@title').replaceAll(" ","_")
def file = new File("/Users/danilat/Music/goear/${id}-${name}.mp3").newOutputStream()
file << new URL(mp3).openStream()
file.close()
println "${name} has been downloaded"
}