Skip to content

Instantly share code, notes, and snippets.

@jpfinley
Created July 27, 2011 16:01
Show Gist options
  • Save jpfinley/1109676 to your computer and use it in GitHub Desktop.
Save jpfinley/1109676 to your computer and use it in GitHub Desktop.
XMLElement xml;
void setup() {
size(200, 200);
String url = YOUR_URL_HERE;
xml = new XMLElement(this, url);
XMLElement[] tracks = xml.getChildren("recenttracks/track");
for (int i = 0; i < tracks.length; i++) {
XMLElement artist = tracks[i].getChild("artist");
XMLElement name = tracks[i].getChild("name");
XMLElement dateElement = tracks[i].getChild("date");
int date = dateElement.getInt("uts");
println(date + " : " + artist.getContent() + " : " + name.getContent());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment