1
0
mirror of https://gitlab.com/2-chainz/2-chainz-rest-site.git synced 2025-06-16 07:06:51 +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> </blockquote>
<script> <script>
getQuote();
// Get new quote every 15 minutes // Get new quote every 15 minutes
setInterval(getQuote, 900000); setInterval(getQuote, 900000);
function getQuote() { function getQuote() {
fetch("https://api.chainz.rest/quote", { method: "GET" }) fetch("https://chainz-rest.azurewebsites.net/quote", { method: "GET" })
.then((resp) => resp.json()) .then((resp) => resp.json())
.then(function (data) { .then(function (data) {
document.getElementById("quote").innerHTML = data.quote; 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((resp) => resp.json())
.then(function (data) { .then(function (data) {
document.getElementById("alias").innerHTML = "- " + data.alias; document.getElementById("alias").innerHTML = "- " + data.alias;