Skip to content

Instantly share code, notes, and snippets.

@LukeXF
Created January 27, 2015 00:50
Show Gist options
  • Save LukeXF/7242c5e38c716b7b8169 to your computer and use it in GitHub Desktop.
Save LukeXF/7242c5e38c716b7b8169 to your computer and use it in GitHub Desktop.
Ping server
<script>
function ServerStatus(serverip){
$.getJSON('http://mcapi.ca/query/' + serverip + '/players', function(json){
if (json.status !== true) {
$('#players').html("0");
} else {
$("#players").html(json.players.online);
}
});
}
ServerStatus('play.purepvp.org');
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment