1
0
mirror of https://gitlab.com/2-chainz/2-chainz-rest-site.git synced 2025-06-15 14:46:48 +00:00

small fixes

This commit is contained in:
Anson 2022-12-02 15:36:21 -07:00
parent 8c2654d4a1
commit 3a07687138

View File

@ -57,24 +57,18 @@
</blockquote>
<script>
getQuote();
// Get new quote every 15 minutes
setInterval(getQuote, 900000);
function getQuote() {
fetch("https://api.chainz.rest/quote", { method: "GET" })
fetch("https://chainz-rest.azurewebsites.net/quote", { method: "GET" })
.then((resp) => resp.json())
.then(function (data) {
document.getElementById("quote").innerHTML = data.quote;
const tweet = encodeURIComponent(
`"${data.quote}" -@2chainz via https://2.chainz.rest`
);
document.getElementById(
"tweet"
).href = `https://twitter.com/intent/tweet?text=${tweet}`;
});
fetch("https://api.chainz.rest/alias", { method: "GET" })
fetch("https://chainz-rest.azurewebsites.net/alias", { method: "GET" })
.then((resp) => resp.json())
.then(function (data) {
document.getElementById("alias").innerHTML = "- " + data.alias;