Skip to content

Instantly share code, notes, and snippets.

@jhargis
Forked from nloko/rdio_pl_export.js
Created November 20, 2015 01:20
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 jhargis/a4b3e1cb52aee1d26200 to your computer and use it in GitHub Desktop.
Save jhargis/a4b3e1cb52aee1d26200 to your computer and use it in GitHub Desktop.
Export Rdio playlist as CSV
javascript:(function() {
var bookmarklet = {
init: function() {
this.parse();
},
parse: function() {
page = "";
/* you must be viewing songs ie. http://www.rdio.com/people/nloko/collection/songs/
when exporting a collection and this will only export the songs loaded in view,
not the entire collection. */
$(".Track:visible")
.children(".info")
.each(function() {
line = [];
function buildLine() {
line.push("\"" + $(this).text() + "\"");
}
$(this).children(".name").children("a").each(buildLine);
$(this).children(".metadata").children("a").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);
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment