var titles=""; a_tags=document.getElementsByTagName("a"); for (var count=46; count < a_tags.length; count++) { var current_title=a_tags[count].getAttribute("title"); if(current_title!=null) /* filter invalid data */ { var video_id=a_tags[count].getAttribute("href").replace(/.*watch\?v=/,""); /* extract IDs */ if (video_id.length == 11) /* filter invalid data */ { titles+="\n"+video_id+"\x09"+current_title; /* add to title */ } }; } document.body.innerHTML+="
"+titles+"";