Skip to content

Instantly share code, notes, and snippets.

@andrienko
Last active August 29, 2015 14:12
Show Gist options
  • Save andrienko/d140e7aa3918e108e81a to your computer and use it in GitHub Desktop.
Save andrienko/d140e7aa3918e108e81a to your computer and use it in GitHub Desktop.
Get links to all tracks on bandcamp page in pretty form
document.body.innerHTML = ((function(d,o){
o.y=new Date(d.album_release_date).getFullYear();
o.r=['<h1>'+ o.a([d.artist,o.y,d.current.title].join(' - '),d.url)+'</h1>'];
(o.u = d.artFullsizeUrl) && o.r.push('<img src="'+ o.u+'"/>');
d.trackinfo.forEach(function(t){
for(o.i in t.file){}
o.r.push(o.a((""+t.track_num).replace(/^(\d{1})$/g,'0$1') + ' - '+ t.title+'.mp3',t.file[o.i]));
});
return o.r.join("<br/>\n");
})(TralbumData,{a:function(c,u){return '<a href="'+u+'">'+c+"</a>"}}));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment