Created
February 7, 2013 15:26
-
-
Save theophani/4731629 to your computer and use it in GitHub Desktop.
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
Drag this to your bookmark bar: <a href='javascript: (function () { | |
var pid; | |
var p_url; | |
var S = require("models/sound"); | |
var playlists = require("models/playlist").instances._store; | |
for (p in playlists) { | |
p_url = playlists[p].attributes.permalink_url.split("/")[5]; | |
if (p_url == window.location.pathname.split("/")[3]) { | |
pid = p; | |
} | |
} | |
var playlist = require("models/playlist").instances.get(pid); | |
var track_ids = prompt("GIMME TR4CK 1Ds NOA.\nComma delimited, thanks").replace(" ", "").split(","); | |
while (playlist.soundsCollection.length) { | |
playlist.removeSound(playlist.soundsCollection.at(0)); | |
} | |
playlist.set({title: "H4CKED S3T!!1!" }); | |
var defs = track_ids.map(function (t_id) { | |
var s = new S({id: t_id}); | |
return s.fetch().done(function () { | |
playlist.addSound(s); | |
s.release(); | |
}); | |
}); | |
$.whenAll(defs).done(function () { | |
Array.prototype.forEach.call(document.querySelectorAll(".trackList__newListItem"), function(el) { | |
el.classList.remove("trackList__newListItem") | |
}); | |
}); | |
}());'>MAKE ME A SET</a>, and then click it while looking at any set on SoundCloud |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment