~mika/www.m1kadev.nl

ref: 1c5e50a88b88ab1d2e500cdec0ab3257da2dce11 www.m1kadev.nl/scripts/showMotd.js -rw-r--r-- 411 bytes
1c5e50a8 — m1kadev kethel: start stage 1 of build api: collect 6 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
const motdElement = document.getElementById("motd").children[0];

fetch("/static/motds").then(async rres => {
    const res = (await rres.text());
    const motds = res.split("\n").map(motd => motd.split("#", 2));
    let motd = motds[Math.floor(Math.random() * motds.length)];
    console.log(motd);
    motdElement.innerHTML = motd[0].trimEnd();
    motdElement.setAttribute("title", motd[1].trimStart());
});