Last active
August 29, 2015 14:12
-
-
Save andrienko/d140e7aa3918e108e81a to your computer and use it in GitHub Desktop.
Get links to all tracks on bandcamp page in pretty form
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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