mirror of
https://github.com/LiteyukiStudio/LiteyukiBot.git
synced 2024-11-14 17:17:24 +08:00
27 lines
643 B
JavaScript
27 lines
643 B
JavaScript
|
|
function updatePageData() {
|
|
fetch("https://api.liteyuki.icu/count")
|
|
.then(res => res.json())
|
|
.then(data => {
|
|
let total = document.getElementById("total");
|
|
if(total !== null) {
|
|
total.innerText = data.register;
|
|
}
|
|
})
|
|
.catch(err => console.error(err));
|
|
|
|
fetch("https://api.liteyuki.icu/online")
|
|
.then(res => res.json())
|
|
.then(data => {
|
|
let online = document.getElementById("online");
|
|
if(online !== null) {
|
|
online.innerText = data.online;
|
|
}
|
|
})
|
|
.catch(err => console.error(err));
|
|
}
|
|
|
|
updatePageData();
|
|
setInterval(() => {
|
|
updatePageData();
|
|
}, 1000); |