var nowPlayingTimeout;
var nowPlaying;

function loadNowPlaying() {
$.ajax({
cache: false,
dataType: « json »,
url: ‘https://montagne.azuracastfcp.cf/api/nowplaying/radiopantin’,
success: function(np) {
// Do something with the Now Playing data.
nowPlaying = np;

nowPlayingTimeout = setTimeout(loadNowPlaying, 15000);
}
}).fail(function() {
nowPlayingTimeout = setTimeout(loadNowPlaying, 30000);
});
}

$(function() {
loadNowPlaying();
});

Copy link
Powered by Social Snap