Skip to content

Instantly share code, notes, and snippets.

Created Jun 15, 2020
What would you like to do?
Stargazer count
<!DOCTYPE html>
<html lang="en">
<script src=""></script>
<p>Project <span id="repo">aquasecurity/trivy</span> <span id="starcount"></span></p>
function getStarcount(repo, resultElement) {
var url = '' + repo;
.then(function (response) {
resultElement.innerHTML =;
.catch(function (error) {
function repo() {
var repo = document.getElementById('repo').innerHTML;
var starcount = document.getElementById('starcount');
getStarcount(repo, starcount);
document.addEventListener('DOMContentLoaded', repo());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment