Fixes MAMAFOOD
All checks were successful
Update menicka / update-rss (push) Successful in 5m12s

This commit is contained in:
2025-08-14 11:05:25 +02:00
parent 1f77562f61
commit fdcb3a3161
2 changed files with 22 additions and 8 deletions

13
cli.mjs
View File

@@ -94,16 +94,21 @@ async function menickoMamafoodbistro(){
const { document }= await fetchHTML(url);
const menicko= document.querySelectorAll("section")[2].getElementsByClassName("sqs-html-content")[1];
const dny= {};
for(const den of menicko.getElementsByTagName("h4")){
const section= el=> el.getElementsByClassName("sqsrte-text-color--accent");
const textContent= el=> {
el.getElementsByTagName("strong")[0].remove();
return el.textContent.trim();
};
for(const den of Array.from(section(menicko)).map(el=> el.parentElement)){
const polevka= den.nextElementSibling;
if(!polevka) break;
let hi= polevka;
const hlavni= [];
while(( hi= hi.nextElementSibling ) && hi.tagName !== "H4")
while(( hi= hi.nextElementSibling ) && section(hi).length===0)
hlavni.push(hi);
Reflect.set(dny, den.textContent.trim().toLowerCase(), {
polevky: [ polevka.textContent ],
hlavni: hlavni.map(el=> el.textContent),
polevky: [ textContent(polevka) ],
hlavni: hlavni.map(textContent),
});
}