Last active
August 29, 2015 14:02
-
-
Save caiovaccaro/461c3ca7b712305319f7 to your computer and use it in GitHub Desktop.
bookmarklet to export rdio ##Collection## to ivy
This file contains hidden or 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 bookmarklet = { | |
init: function() { | |
this.parse(); | |
}, | |
parse: function() { | |
page = ""; | |
$.each($(".SourceList:visible").find(".Track"), function() { | |
line = []; | |
function buildLine() { | |
line.push($(this).text()); | |
} | |
$(this).find(".metadata").children("a:first").each(buildLine); | |
$(this).find(".name").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