I have an xml document on my computer that basically looks like this:
<item playlist="3" gameid="32" catid="1" title="Cul-De-Sac of Memories" artist="Christopher Lennertz" scr="../mp3/sims3p/build/cul-de-sac_of_memories.flv" />
<item playlist="3" gameid="30" catid="4" title="Brave" artist="Kelis" scr="../mp3/sims3ln/electronica/brave.flv" />
<item playlist="3" gameid="15" catid="1" title="First Volley" artist="General Midi" scr="../mp3/sims2nl/build/general_midi_-_first_volley.flv" />
Except that it has much more items than that (and some comments). I've been desperately trying to find a way to get a program/script to:
- Take the url in between
src="
and the very next"
in the xml tag. - Replace the
../
in the url withhttp://www.WEBSITE.com/
and maybe store it as a variable, likeSong_URL
. - Take the song name in between
title="
and the very next"
from the same tag it got the url from, and maybe store that a variable too, likeSong_Name
. - Download the song from the
Song_URL
and name itSong_Name
.
For every tag like that in the document. Note that some tags in the document look like this: <item playlist="2" gameid="28" catid="2" title="Load" />
and don't matter to me.
I know a tiny bit of Bash, Applescript, and Python, but don't know enough of any to do this. If anyone could please help me do this, in whatever programming language you please (it could be in the 3 I listed, or in Java, Ruby, C or whatever else you want), however you want, I would very much appreciate it!