illpastethat

live_get.js

Dec 28th, 2012
173
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var player=(document.player)?document.player:document.getElementById('player');
  2. setInterval('live_get()',4500);
  3. function live_get() {
  4.   if (document.getElementById("var4").innerHTML === "one") {
  5.     var sc = document.getElementById("var3").innerHTML;
  6.   }else{ sc = document.getElementById("var1").innerHTML; }
  7.   var z = sc.indexOf("[[")+2;
  8.   var x = sc.indexOf("-");
  9.   var y = x-z;
  10.   var live_song_artist = sc.substr(z, y);
  11.   var live_song_artist = live_song_artist.replace("'","'","&","&");
  12.   var z = sc.indexOf("-")+2;
  13.   var x = sc.indexOf("]]");
  14.   var y = x-z;
  15.   var live_song = sc.substr(z, y);
  16.   var live_song = live_song.replace("'","'","&","&");
  17.   var d = sc.indexOf("{{")+2;
  18.   var e = sc.indexOf("}}");
  19.   var f = e-d;
  20.   var live_dj = sc.substr(d, f);
  21.   var live_dj = live_dj.replace("'", "'", "&", "&");
  22.   var g = sc.indexOf("((")+2;
  23.   var h = sc.indexOf("))");
  24.   var i = h-g;
  25.   var live_bitrate = sc.substr(g, i);
  26.   var currentTime = new Date()
  27.   var second = currentTime.getSeconds()
  28.   if ((second/2) > 25  ) {
  29.     if(fallback === 'true') {
  30.       var livetitle = orig_title;
  31.     }else {
  32.       var livetitle = orig_title+"@"+live_bitrate+"kbps";
  33.     }
  34.   }else if ((second/2) > 20 ) {
  35.     var livetitle = "DJ:"+live_dj;
  36.   }else if ((second/2) > 15 ) {
  37.     var livetitle = "Song:"+live_song;
  38.   }else if ((second/2) > 10 ) {
  39.     var livetitle = "Artist:"+live_song_artist;
  40.   }
  41. javascript:player.setTitle(livetitle);
  42. };
Add Comment
Please, Sign In to add comment