Skip to content

Instantly share code, notes, and snippets.

@katydecorah
Last active August 29, 2015 13:57
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 katydecorah/9574336 to your computer and use it in GitHub Desktop.
Save katydecorah/9574336 to your computer and use it in GitHub Desktop.
Export an Rdio playlist to YAML. The code is a bit hacky, but it does the trick for now. [1] Make sure playlist is fully loaded. [2] open Share modal. [3] hit the bookmarklet [adapted from here](https://gist.github.com/nloko/3001053). [4] i love you.
javascript: (function () {
var a = {
init: function () {
this.parse()
},
parse: function () {
page = "";
var e = $(".playlist_name").find(".name").text();
var d = $(".short_link").find("input").val();
var c = $(".catalog_art .ImageLoader").attr("src");
$(".Track:visible").children(".info").each(function () {
line = [];
function h() {
line.push(' - track: "' + $(this).text() + '"')
}
function f() {
line.push(' artist: "' + $(this).text() + '"')
}
function g() {
line.push(' album: "' + $(this).text() + '"')
}
$(this).children(".name").children("a").each(h);
$(this).children(".metadata").children("a:first").each(f);
$(this).children(".metadata").children("a").each(g);
page += line.join("\r\n") + "\r\n"
});
window.open("data:text/plain;charset=utf-8," + encodeURIComponent(" - playlist: " + e + "\r\n rdio: " + d + "\r\n image: " + c + "\r\n tracks:\r\n" + page), "")
}
};
if (!window.jQuery) {
b()
} else {
a.init()
}
function b() {
var c = document.createElement("script");
c.src = "http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js";
c.async = true;
c.type = "text/javascript";
c.onload = function () {
a.init()
};
document.body.appendChild(c)
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment