Created
April 28, 2017 05:40
-
-
Save leovarmak/c4807e976c7456f303a844c57fca7f24 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.0/jquery.min.js"></script> | |
<script> | |
$(document).ready(function(){ | |
getStats(); //Executes the function to get stats from the steam gauge API | |
setInterval(function(){ // This functions automatically | |
getStats(); // sends a G request every 60 seconds | |
}, 60000); | |
function getStats() { | |
$.getJSON( "https://steamgaug.es/api/v2", function( data ){ | |
console.log(data.ISteamGameCoordinator[570].online) | |
console.log(data.ISteamGameCoordinator[570].stats.players_searching); | |
if (data.ISteamGameCoordinator[570].online == 1) { | |
alert("Dota 2 is Online \nPlayers searching right now: " +data.ISteamGameCoordinator[570].stats.players_searching); | |
} | |
}); | |
} | |
}); | |
</script> | |
</head> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment