Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Aug 19th, 2010  |  syntax: JavaScript  |  size: 0.63 KB  |  views: 46  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. function inbtwn(a,b,c){
  2.         try{
  3.                 var a1 = a.split(b);
  4.                 var a2 = a1[1].split(c);
  5.                 return a2[0];
  6.         }
  7.         catch(err){
  8.                 return '';
  9.         }
  10. }
  11. function inbtwn2(a,b,c){
  12.         try{
  13.                 var a1 = a.split(b);
  14.                 var a2 = a1[2].split(c);
  15.                 return a2[0];
  16.         }
  17.         catch(err){
  18.                 return '';
  19.         }
  20. }
  21. var src = document.body.innerHTML.toString();
  22. if(window.location.toString().toLowerCase().match('youtube.com/')){
  23.         var v = inbtwn(src, 'video_id=', '&');
  24.         var t = inbtwn(src, '&t=', '&');
  25.         var fl = inbtwn(src, '&fmt_list=', '&');
  26.         var title = inbtwn2(src, 'title=%22', '%22');
  27.         if(title == ''){
  28.                 title = inbtwn(src, '%3Ch1 id=%22vt%22%3E', '%3C');
  29.         };
  30. }
clone this paste RAW Paste Data