Template:ServerStat

<!DOCTYPE html> Online players   func; var seconds = 5; /* Your Refresh Rate */ setInterval(function{       func;    }, seconds * 1000); function func{ var ip = "mineslam.me"; var xhr = new XMLHttpRequest; xhr.open("GET", "http://minecraft-api.com/v1/get/?server=" + ip, true); xhr.onreadystatechange = function { if (xhr.readyState == 4) { data = JSON.parse(xhr.responseText); if (data.status) { document.getElementById("bar").innerHTML=data.players.online + "/" + data.players.max; document.getElementById("bar").style.width = Math.round(100*(data.players.online/data.players.max)) + "%"; }               }         }         xhr.send; }  0/0