Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.