Amend scripts to include personal access token

This commit is contained in:
Thomas Smith 2023-03-09 11:57:11 -05:00
parent 310c88303a
commit 28981534d5

View file

@ -143,25 +143,37 @@ integrity="sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+
$(document).ready(function() { $(document).ready(function() {
var repository = "teaxyz/cli"; var repository = "teaxyz/cli";
var url = "https://api.github.com/repos/" + repository; var url = "https://api.github.com/repos/" + repository;
var token = "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";
$.get(url, function(data) { $.ajax({
var stargazers = "(" + numeral(data.stargazers_count).format("0.0a") + ")"; url: url,
$(".stargazers").html(stargazers).hide().fadeIn(400); headers: {
"Authorization": "token " + token
},
success: function(data) {
var stargazers = "(" + numeral(data.stargazers_count).format("0.0a") + ")";
$(".stargazers").html(stargazers).hide().fadeIn(400);
}
}); });
}); });
</script> </script>
<script> <script>
$(document).ready(function() {
var repository = "teaxyz/cli";
var url = "https://api.github.com/repos/"+ repository +"/releases/latest";
var token = "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";
$(document).ready(function() { $.ajax({
var repository = "teaxyz/cli"; url: url,
var url = "https://api.github.com/repos/"+ repository +"/releases/latest"; headers: {
"Authorization": "token " + token
$.get(url, function(data) { },
var release = data.tag_name; success: function(data) {
$(".release").html(release).hide().fadeIn(400); var release = data.tag_name;
}); $(".release").html(release).hide().fadeIn(400);
}); }
});
</script> });
</script>