Skip to content

Instantly share code, notes, and snippets.

@andrienko

andrienko/bandcamp

Last active Aug 29, 2015
Embed
What would you like to do?
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