JSFiddle - React, Tailwind, and code Playground
HTML
<span class="trackinfo"></span>
JavaScript
$(window).ready(function() {
function getstats() {
// Attempt to get stats for "Demo Channel" channel
$.getJSON('http://www.musikmixen.se/stationer/?c=MusikMixen-Dansband&callback=?', function(response) {
if ( response == null || response.artist == null )
alert('Something went wrong!');
$('.trackinfo').html(response.artist + ' - ' + response.title + '<br><img width="120" height="120" class="thumbnail" src="http://www.musikmixen.se/stationer/' + response.image + '">');
});
}
getstats(); // First-time load
setInterval(getstats, 10000); // Reload information every 10 sec
});