$(document).ready(function() { RefreshTitlesarionstigmes(); }); function addTimeStamp(){ tstmp = new Date(); return tstmp.getTime(); } function RefreshTitlesarionstigmes() { $.ajax({ type: "GET", url: "https://onair.e-radio.gr/whatson/arion/arionstigmes/NowOnAir.xml?timestamp="+addTimeStamp(), dataType: "xml", success: ShowTitleArtistarionstigmes }); //alert("/whatson_remote/updateartistpic.asp?timestamp="+addTimeStamp()+"&q="+qArtist); $.ajax({ type: "GET", url: "https://onair.e-radio.gr/whatson/arion/arionstigmes/AirPlayNext.xml?timestamp="+addTimeStamp(), dataType: "xml", success: ShowNextSongsarionstigmes }); $.ajax({ type: "GET", url: "https://onair.e-radio.gr/whatson/arion/arionstigmes/AirPlayHistory.xml?timestamp="+addTimeStamp(), dataType: "xml", success: ShowLastSongsarionstigmes }); } function ShowTitleArtistarionstigmes(xml) { $(xml).find("Song").each(function() { qTitle = $(this).attr("title"); $("#arionstigmes_title").html($(this).attr("title")); $(xml).find("Artist").each(function() { $("#arionstigmes_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: ShowNowPicarionstigmes }); */ }); }); } function ShowNowPicarionstigmes(txt) { if (txt!=''){ $("#arionstigmes_pic").attr("src",txt); $("#arionstigmes_pic").show(); } else{ $("#arionstigmes_pic").attr("src",''); $("#arionstigmes_pic").hide(); } } function ShowLastSongsarionstigmes(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")+ "
"; }); $("#arionstigmes_lastsongs").html(tmpLastSongs); } function ShowNextSongsarionstigmes(xml) { var j=0; $(xml).find("Song").each(function() { if (j==0 ){ $("#arionstigmes_nexttitle").html( $(this).attr("title") ); $("#arionstigmes_nextartist").html( $(this).find("Artist").attr("name") ); } j=j+1; $("#nextheader").show(); }); } var oRefresharionstigmes; oRefresharionstigmes = window.setInterval("RefreshTitlesarionstigmes()", 50000);