Skip to content

Instantly share code, notes, and snippets.

@mutaku
Created March 18, 2011 01:35
Show Gist options
  • Save mutaku/875482 to your computer and use it in GitHub Desktop.
Save mutaku/875482 to your computer and use it in GitHub Desktop.
bookmarklet to get all video links in youtube playlist displayed in alert
javascript:
if (typeof jQuery == 'undefined') {
var jQ = document.createElement('script');
jQ.type = 'text/javascript';
jQ.onload=runthis;
jQ.src = 'http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js';
document.body.appendChild(jQ);
}
else {
runthis();
}
function runthis() {
var thelinks = "";
var thislink;
$('div.vm-video-title').each(function() {
thislink = $(this).find('a').attr('href');
thislink = "http://youtube.com" + thislink + "\n";
thelinks = thelinks + thislink;
});
if(thelinks.length != 0){
alert(thelinks);
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment