$(document).ready(function() { RefreshTitlesathenspartyrnb(); }); function addTimeStamp(){ tstmp = new Date(); return tstmp.getTime(); } function RefreshTitlesathenspartyrnb() { $.ajax({ type: "GET", url: "https://onair.e-radio.gr/whatson/athensparty/athenspartyrnb/NowOnAir.xml?timestamp="+addTimeStamp(), dataType: "xml", success: ShowTitleArtistathenspartyrnb }); //alert("/whatson_remote/updateartistpic.asp?timestamp="+addTimeStamp()+"&q="+qArtist); $.ajax({ type: "GET", url: "https://onair.e-radio.gr/whatson/athensparty/athenspartyrnb/AirPlayNext.xml?timestamp="+addTimeStamp(), dataType: "xml", success: ShowNextSongsathenspartyrnb }); $.ajax({ type: "GET", url: "https://onair.e-radio.gr/whatson/athensparty/athenspartyrnb/AirPlayHistory.xml?timestamp="+addTimeStamp(), dataType: "xml", success: ShowLastSongsathenspartyrnb }); } function ShowTitleArtistathenspartyrnb(xml) { $(xml).find("Song").each(function() { qTitle = $(this).attr("title"); $("#athenspartyrnb_title").html($(this).attr("title")); $(xml).find("Artist").each(function() { $("#athenspartyrnb_artist").html($(this).attr("name")); qArtist = $(this).attr("name"); /*$.ajax({ type: "GET", url: "/whatson_remote/updatetrackpic.asp?timestamp="+addTimeStamp()+"&t="+qTitle+"&a="+qArtist, dataType: "text", success: ShowNowPicathenspartyrnb }); */ }); }); } function ShowNowPicathenspartyrnb(txt) { if (txt!=''){ $("#athenspartyrnb_pic").attr("src",txt); $("#athenspartyrnb_pic").show(); } else{ $("#athenspartyrnb_pic").attr("src",''); $("#athenspartyrnb_pic").hide(); } } function ShowLastSongsathenspartyrnb(xml) { var tmpLastSongs=""; $(xml).find("Song").each(function() { tmpLastSongs = tmpLastSongs + $(this).find("Info").attr("StartTime")+ " > "; tmpLastSongs = tmpLastSongs +"" + $(this).attr("title") + " >"; tmpLastSongs = tmpLastSongs + $(this).find("Artist").attr("name")+ "
"; }); $("#athenspartyrnb_lastsongs").html(tmpLastSongs); } function ShowNextSongsathenspartyrnb(xml) { var j=0; $(xml).find("Song").each(function() { if (j==0 ){ $("#athenspartyrnb_nexttitle").html( $(this).attr("title") ); $("#athenspartyrnb_nextartist").html( $(this).find("Artist").attr("name") ); } j=j+1; $("#nextheader").show(); }); } var oRefreshathenspartyrnb; oRefreshathenspartyrnb = window.setInterval("RefreshTitlesathenspartyrnb()", 50000);