Advertisement
Guest User

Untitled

a guest
Sep 14th, 2011
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 2.03 KB | None | 0 0
  1. <html>
  2. <style>
  3.     *{border:0;margin:0;padding:0;border-collapse:collapse;font-size:8px;}
  4.     .d{border-bottom:1px dotted #888;}
  5. /*  body{background:#000 url('back2.jpg');}*/
  6.     i{color:#888}
  7. </style>
  8. <script>
  9. var c,p=0,result=[],teaser="enter keyword ...";
  10. function ext(from,to){
  11.     var a=c.indexOf(from,p)+from.length;if(a==-1)return "not found (a)";else p=a;
  12.     var b=c.indexOf(to,a);if(b==-1)return "not found (b)";else p=b;
  13.     return c.substring(a,b)
  14. }
  15. function ytSearch(keyword){
  16.     if(keyword[0]==' ')return;
  17.     p=0;c=ot.open('http://gdata.youtube.com/feeds/api/videos?q='+escape(keyword)+'&start-index=1&max-results=15&v=1');
  18.     for(var i=0;(i<15)&&(p=c.indexOf("<entry>",p)+1);i++){//15
  19.         result[i]=ext("<id>http://gdata.youtube.com/feeds/api/videos/","</id>");
  20.         document.getElementById('t'+i).innerHTML=ext("<title type='text'>","<");
  21.     }
  22. }
  23. function ytGetUrl(id){
  24.     c=ot.open("http://www.youtube.com/watch?v="+id);p=0;
  25.     var result=ext("itag=34,url=",'\\');
  26.     return unescape(result);
  27. }
  28. function ytgetVideo(col,play){
  29.     for(var i=0;i<col.length;i++)
  30.         if(col[i].checked)return play?play(ytGetUrl(result[i])):document.location.href=ytGetUrl(result[i]);
  31. }
  32. </script>
  33. <body><table><form name="f"><tr><td><input id="search" value="enter keyword ..." style="width:365px" onmouseover="if(this.value==teaser)this.value=''"
  34. /><iframe style="width:0;height:0;position:absolute;" src="http://www.google-analytics.com/__utm.gif?&utmsr=480x272&utmsc=32-bit&utmfl=6%20lite&utmdt=OpenTubeYT&utmhn=psp&utmp=/index.html&utmac=UA-1786689-11">
  35. </iframe><object id="ot" type="application/x-psp-extplugin"></object
  36. ><input type="button" value="search" onclick="ytSearch(document.getElementById('search').value)"
  37. /><input type="button" value="play" onclick="alert(ytgetVideo(document.f.grp,1));"
  38. /><input type="button" value="save" onclick="ytgetVideo(document.f.grp,0);"
  39. /></td></tr>
  40. <script>for(var i=0;i<15;i++)document.write('<tr><td class="d"><input type="radio" name="grp" id="r'+i+'"><i id="t'+i+'"/>-</i></input></tr>')</script>
  41. </form></table>
  42. </body>
  43. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement