Skip to content

Instantly share code, notes, and snippets.

@eyecatchup
Last active June 15, 2016 00:44
Show Gist options
  • Save eyecatchup/6f24af07731c80f1817dc46e7143101d to your computer and use it in GitHub Desktop.
Save eyecatchup/6f24af07731c80f1817dc46e7143101d to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8"/>
<title>UEFA Euro 2016 JavaScript Api Examples</title>
<style>.gist .markdown-body .highlight pre, .gist .markdown-body pre{font-size: 15px !important;}</style>
</head>
<body>
<header>
<h1>UEFA Euro 2016 JavaScript Api Examples</h1>
</header>
<p>See JS console for the result of the following code examples.</p>
<p>Copyright 2016, Stephan Schmitz</p>
<script src="//gist.github.com/eyecatchup/5c3e4629de5443104cc8b1e533022be8.js"></script>
<!-- UEFA API wrapper -->
<script src='//gist.githubusercontent.com/eyecatchup/ec3c162cf455843c03606eeae0a65d71/raw/721e1e5da8e8ec0114e66955055e77ada22edddf/UefaApi.js'></script>
<!-- Example usage -->
<script>
(function(window) {
try {
var api = window.UefaApi;
/**
* Get match details by UEFA match id.
*/
api.getMatch(2017959, function(response) {
window.console.log("Success callback");
window.console.dir(response);
}, function() {
window.console.log("Failure callback");
});
/**
* Get detailed team statistics by UEFA match id.
*/
api.getMatchTeamstats(2017959, function(response) {
window.console.log("Success callback");
window.console.dir(response);
}, function() {
window.console.log("Failure callback");
});
/**
* Get detailed player statistics by UEFA match id.
*/
api.getMatchPlayerstats(2017959, function(response) {
window.console.log("Success callback");
window.console.dir(response);
}, function() {
window.console.log("Failure callback");
});
/**
* Get current standings of Group C in Euro 2016.
*/
api.get('/EN/groups/2002443/standings', function(response) {
window.console.log("Success callback");
window.console.dir(response);
}, function() {
window.console.log("Failure callback");
});
/**
* Get team profile of Germany.
*/
api.get('/EN/competitions/3/seasons/2016/teams/47', function(response) {
window.console.log("Success callback");
window.console.dir(response);
}, function() {
window.console.log("Failure callback");
});
} catch (e) {
}
})(window);
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment