-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscripts.js
32 lines (28 loc) · 889 Bytes
/
scripts.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
function random_namecall() {
const names = [
"pudding head",
"stupid",
"lazy",
"little fool",
"baka",
"ur little baby",
"hoodwink picker",
]
return names[Math.floor(Math.random()*names.length)]
}
function get_counts_async() {
var xmlHttp = new XMLHttpRequest();
xmlHttp.onreadystatechange = function() {
if (xmlHttp.readyState == 4 && xmlHttp.status == 200){
const resp = JSON.parse(xmlHttp.responseText);
document.getElementById('today').innerHTML = resp.last_24h;
document.getElementById('ever').innerHTML = resp.forever;
}
}
xmlHttp.open("GET", "https://us-central1-hitcount-321920.cloudfunctions.net/hitcount-plus-one-1", true); // true for asynchronous
xmlHttp.send(null);
}
window.onload = function() {
document.getElementById('namecall').innerHTML = random_namecall();
get_counts_async();
};