$(document).ready(function() { RefreshTitlesathensparty(); }); function addTimeStamp(){ tstmp = new Date(); return tstmp.getTime(); } function RefreshTitlesathensparty() { $.ajax({ type: "GET", url: "https://onair.e-radio.gr/whatson/athensparty/athensparty/NowOnAir.xml?timestamp="+addTimeStamp(), dataType: "xml", success: ShowTitleArtistathensparty }); //alert("/whatson_remote/updateartistpic.asp?timestamp="+addTimeStamp()+"&q="+qArtist); $.ajax({ type: "GET", url: "https://onair.e-radio.gr/whatson/athensparty/athensparty/AirPlayNext.xml?timestamp="+addTimeStamp(), dataType: "xml", success: ShowNextSongsathensparty }); $.ajax({ type: "GET", url: "https://onair.e-radio.gr/whatson/athensparty/athensparty/AirPlayHistory.xml?timestamp="+addTimeStamp(), dataType: "xml", success: ShowLastSongsathensparty }); } function ShowTitleArtistathensparty(xml) { $(xml).find("Song").each(function() { qTitle = $(this).attr("title"); $("#athensparty_title").html($(this).attr("title")); $(xml).find("Artist").each(function() { $("#athensparty_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: ShowNowPicathensparty }); */ }); }); } function ShowNowPicathensparty(txt) { if (txt!=''){ $("#athensparty_pic").attr("src",txt); $("#athensparty_pic").show(); } else{ $("#athensparty_pic").attr("src",''); $("#athensparty_pic").hide(); } } function ShowLastSongsathensparty(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")+ "
"; }); $("#athensparty_lastsongs").html(tmpLastSongs); } function ShowNextSongsathensparty(xml) { var j=0; $(xml).find("Song").each(function() { if (j==0 ){ $("#athensparty_nexttitle").html( $(this).attr("title") ); $("#athensparty_nextartist").html( $(this).find("Artist").attr("name") ); } j=j+1; $("#nextheader").show(); }); } var oRefreshathensparty; oRefreshathensparty = window.setInterval("RefreshTitlesathensparty()", 50000);