mirror of
https://github.com/LiteyukiStudio/LiteyukiBot.git
synced 2025-07-30 21:39:51 +00:00
Deploying to gh-pages from @ LiteyukiStudio/LiteyukiBot@61680d9e87 🚀
This commit is contained in:
27
js/get_data.js
Normal file
27
js/get_data.js
Normal file
@ -0,0 +1,27 @@
|
||||
|
||||
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);
|
Reference in New Issue
Block a user