Beautiful Poetic JavaScript-Commenting
JavaScript, auskommentiert als Gedicht. Brillant! Ich hab’ hier mal ‘ne lokale Kopie gesichert: http://www.crackajack.de/wonder/lunametrics-youtube.js.
if(vidSrc.length>29){
if(vidSrc.substr(0,29)=="http://www.youtube.com/embed/"){
//It is a YouTube video!
//Rip apart it's source to obtain it's
//vile beating heart, the youtube id
var youtubeid = vidSrc.substr(29);
if(youtubeid.substr(-6)=="?rel=0"){
//cut off last 6 digits as hannibal did to atreides
//and offer them to your gods
cutlength = youtubeid.length - 6;
youtubeid = youtubeid.substr(0,cutlength);
}
//we now place the beating heart of the youtube id
//in our first heavenly array
videoArray[i] = youtubeid;
//and then mark the vile iframe beast
//with the id of this video so that all
//may know it, and reference it
$(this).attr('id', youtubeid);
//And for this, I am no longer nothing, I am more
i++;
}
lunametrics-youtube.js (via MeFi)












