Skip to content

Instantly share code, notes, and snippets.

@theophani
Last active December 12, 2015 06:48
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 theophani/4731585 to your computer and use it in GitHub Desktop.
Save theophani/4731585 to your computer and use it in GitHub Desktop.
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