Created
February 13, 2021 07:22
-
-
Save Awilum/991b742a5eab69c5a499b5a1b50cdf33 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
<p style="font-size: 500%; text-align: center">Total Downloads:</p> | |
<p id="downloads-all" style="font-size:1000%; text-align: center"></p> | |
<script type="text/javascript"> | |
let userName = "flextype"; // User name of the repository | |
let repoName = "flextype"; // Repository name | |
let releaseTag = "latest"; // Using tag 'latest' for latest released download count | |
let url = `https://api.github.com/repos/${userName}/${repoName}/releases/${releaseTag}`; | |
let request = new XMLHttpRequest(); | |
request.open('GET', url, true); | |
request.onload = function () { | |
let users = JSON.parse(this.response); | |
let output = users['assets'][0]["download_count"]; | |
console.log(output); | |
document.getElementById('download').innerHTML = output + output2; | |
}; | |
request.send(); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment