Last active
August 29, 2015 13:57
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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