diff options
author | JoelHMikael <joel.h.kronqvist@gmail.com> | 2022-01-04 14:18:20 +0200 |
---|---|---|
committer | JoelHMikael <joel.h.kronqvist@gmail.com> | 2022-01-04 14:18:20 +0200 |
commit | e7b4d365f287f173c8cc0b5a4d965c3a0579c2e0 (patch) | |
tree | b80769ee992b47aaa2aa56828880764531deaab6 /scrape.js | |
parent | 2878bb666d1a2d1032683cd1783dbe6a9b505ba4 (diff) | |
download | LYLLRuoka-e7b4d365f287f173c8cc0b5a4d965c3a0579c2e0.tar.gz LYLLRuoka-e7b4d365f287f173c8cc0b5a4d965c3a0579c2e0.zip |
Minor GUI improvements
Diffstat (limited to 'scrape.js')
-rw-r--r-- | scrape.js | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -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(")", ")<br>").replaceAll(" :", ":").replaceAll(":", ":<br>"); +} + exports.food = scrapeFood; exports.link = getFoodLink; |