Skip to content

Instantly share code, notes, and snippets.

@h4ck4life
Forked from pheuter/sc-dl.js
Created March 6, 2012 02:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save h4ck4life/1983097 to your computer and use it in GitHub Desktop.
Save h4ck4life/1983097 to your computer and use it in GitHub Desktop.
Bookmarklet that generates download link for a Soundcloud upload
(function(d) {
var dl = d.createElement('a');
dl.innerText = 'Download MP3';
dl.href = "http://media.soundcloud.com/stream/"+d.querySelector('#main-content-inner img[class=waveform]').src.match(/\.com\/(.+)\_/)[1];
dl.download = d.querySelector('em').innerText+".mp3";
d.querySelector('.primary').appendChild(dl);
dl.style.marginLeft = '10px';
dl.style.color = 'red';
dl.style.fontWeight = 700;
})(document);
/** Minified **/
(function(b){var a=b.createElement("a");a.innerText="Download MP3";a.href="http://media.soundcloud.com/stream/"+b.querySelector("#main-content-inner img[class=waveform]").src.match(/\.com\/(.+)\_/)[1];a.download=b.querySelector("em").innerText+".mp3";b.querySelector(".primary").appendChild(a);a.style.marginLeft="10px";a.style.color="red";a.style.fontWeight=700})(document);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment