From 28981534d5d8d89bcbba1604ebaf73ff0b1cf5a0 Mon Sep 17 00:00:00 2001 From: Thomas Smith <49042513+tsmitty11@users.noreply.github.com> Date: Thu, 9 Mar 2023 11:57:11 -0500 Subject: [PATCH] Amend scripts to include personal access token --- src/layouts/partials/footer.html | 42 ++++++++++++++++++++------------ 1 file changed, 27 insertions(+), 15 deletions(-) diff --git a/src/layouts/partials/footer.html b/src/layouts/partials/footer.html index e67efa2..b53177d 100644 --- a/src/layouts/partials/footer.html +++ b/src/layouts/partials/footer.html @@ -143,25 +143,37 @@ integrity="sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+ $(document).ready(function() { var repository = "teaxyz/cli"; var url = "https://api.github.com/repos/" + repository; + var token = "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"; - $.get(url, function(data) { - var stargazers = "(" + numeral(data.stargazers_count).format("0.0a") + ")"; - $(".stargazers").html(stargazers).hide().fadeIn(400); + $.ajax({ + url: url, + headers: { + "Authorization": "token " + token + }, + success: function(data) { + var stargazers = "(" + numeral(data.stargazers_count).format("0.0a") + ")"; + $(".stargazers").html(stargazers).hide().fadeIn(400); + } }); }); - + $.ajax({ + url: url, + headers: { + "Authorization": "token " + token + }, + success: function(data) { + var release = data.tag_name; + $(".release").html(release).hide().fadeIn(400); + } + }); + }); +