From e7b4d365f287f173c8cc0b5a4d965c3a0579c2e0 Mon Sep 17 00:00:00 2001 From: JoelHMikael Date: Tue, 4 Jan 2022 14:18:20 +0200 Subject: Minor GUI improvements --- scrape.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'scrape.js') diff --git a/scrape.js b/scrape.js index 45dd0b4..64e00fb 100644 --- a/scrape.js +++ b/scrape.js @@ -49,7 +49,7 @@ async function scrapeFood(url) let weekdayIndex = weekdays.findIndex(val => { return val === title.substring(0, 2); }); if (weekdayIndex !== -1) - foodList[weekdayIndex] = [title, food]; + foodList[weekdayIndex] = [title, neatify(food)]; titleSpan = getSpan(data, titleTags, foodSpan[1]); foodSpan = getSpan(data, foodTags, titleSpan[1]); @@ -63,5 +63,10 @@ function getFoodLink(week) return `https://eruokalista.lohja.fi/AromieMenus/FI/Default/Lohja/Koulut/Rss.aspx?Id=97f76449-f57c-4217-aede-b5f9dbf2b41e&DateMode=${week}`; } +function neatify(food) +{ + return food.replaceAll(")", ")
").replaceAll(" :", ":").replaceAll(":", ":
"); +} + exports.food = scrapeFood; exports.link = getFoodLink; -- cgit v1.2.3