1
0

feat: Absences
All checks were successful
Remote Deploy / deploy (push) Successful in 4s

This commit is contained in:
2025-08-31 16:35:22 +02:00
parent fc8d4d3545
commit 4985d574d5
6 changed files with 374 additions and 26 deletions

View File

@@ -0,0 +1,25 @@
const { default: axios } = require("axios");
const cheerio = require("cheerio");
async function parseTeachers() {
const url = "https://spsejecna.cz/ucitel";
const { data } = await axios.get(url);
const $ = cheerio.load(data);
const map = {};
$("main .contentLeftColumn li, main .contentRightColumn li").each((_, el) => {
const link = $(el).find("a");
const href = link.attr("href"); // e.g. "/ucitel/PA"
const text = link.text().trim(); // e.g. "Ing. Bc. Šárka Páltiková"
if (href) {
const key = href.split("/").pop().toLowerCase(); // get "pa"
map[key] = text;
}
});
return map;
}
module.exports = parseTeachers;