$(document).ready(function() { RefreshTitlesarionradio(); }); function addTimeStamp(){ tstmp = new Date(); return tstmp.getTime(); } function RefreshTitlesarionradio() { $.ajax({ type: "GET", url: "https://onair.e-radio.gr/whatson/arion/arionradio/NowOnAir.xml?timestamp="+addTimeStamp(), dataType: "xml", success: ShowTitleArtistarionradio }); //alert("/whatson_remote/updateartistpic.asp?timestamp="+addTimeStamp()+"&q="+qArtist); $.ajax({ type: "GET", url: "https://onair.e-radio.gr/whatson/arion/arionradio/AirPlayNext.xml?timestamp="+addTimeStamp(), dataType: "xml", success: ShowNextSongsarionradio }); $.ajax({ type: "GET", url: "https://onair.e-radio.gr/whatson/arion/arionradio/AirPlayHistory.xml?timestamp="+addTimeStamp(), dataType: "xml", success: ShowLastSongsarionradio }); } function ShowTitleArtistarionradio(xml) { $(xml).find("Song").each(function() { qTitle = $(this).attr("title"); $("#arionradio_title").html($(this).attr("title")); $(xml).find("Artist").each(function() { $("#arionradio_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: ShowNowPicarionradio }); */ }); }); } function ShowNowPicarionradio(txt) { if (txt!=''){ $("#arionradio_pic").attr("src",txt); $("#arionradio_pic").show(); } else{ $("#arionradio_pic").attr("src",''); $("#arionradio_pic").hide(); } } function ShowLastSongsarionradio(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")+ "
"; }); $("#arionradio_lastsongs").html(tmpLastSongs); } function ShowNextSongsarionradio(xml) { var j=0; $(xml).find("Song").each(function() { if (j==0 ){ $("#arionradio_nexttitle").html( $(this).attr("title") ); $("#arionradio_nextartist").html( $(this).find("Artist").attr("name") ); } j=j+1; $("#nextheader").show(); }); } var oRefresharionradio; oRefresharionradio = window.setInterval("RefreshTitlesarionradio()", 50000);