Skip to content

Instantly share code, notes, and snippets.

@mertdumenci
Last active January 1, 2016 13:49
Show Gist options
  • Save mertdumenci/8153383 to your computer and use it in GitHub Desktop.
Save mertdumenci/8153383 to your computer and use it in GitHub Desktop.
Switch to the list mode in collection view, scroll to the bottom and load all the songs and run this code. You can import it to Spotify using Ivy (ivyishere.org).
javascript:(function() {
var bookmarklet = {
init: function() {
this.parse();
},
parse: function() {
page = "";
$(".collection")
.children(".collection_items")
.find(".Track")
.each(function() {
line = [];
function buildLine() {
line.push($(this).text().replace(/^\s+|\s+$/g, ''));
}
$(this).find(".metadata").find("a:first").each(buildLine);
$(this).find(".name").each(buildLine);
page += line.join(" - ") + "\r\n";
});
window.open("data:text/plain;charset=utf-8," + encodeURIComponent(page), "");
}
};
if (!window.jQuery) {
load();
} else {
bookmarklet.init();
}
function load() {
var script = document.createElement("script");
script.src = "http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js";
script.async = true;
script.type = "text/javascript";
script.onload = function() { bookmarklet.init(); };
document.body.appendChild(script);
}
})();
@nkpz
Copy link

nkpz commented Feb 20, 2014

Thank you! Saved me a bit of work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment