13 lines
663 B
JavaScript
13 lines
663 B
JavaScript
|
const instances = [["kc","https://kitsunes.club/nodeinfo/2.1"],["kg","https://kitsunes.gay/nodeinfo/2.1"], ["kdev", "https://kitsunes.dev/api/v1/nodeinfo"]]
|
||
|
|
||
|
for (const instance of instances) {
|
||
|
fetch(instance[1]).then(response => {
|
||
|
if (!response.ok) throw false;
|
||
|
response.json().then(output => {
|
||
|
console.log(output)
|
||
|
const instanceNode = document.getElementById(instance[0]);
|
||
|
instanceNode.querySelector(".user-count").innerText = output.usage.users.total.toLocaleString('en');
|
||
|
instanceNode.querySelector(".note-count").innerText = output.usage.localPosts.toLocaleString('en');
|
||
|
})
|
||
|
})
|
||
|
}
|