aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoelHMikael <joel.h.kronqvist@gmail.com>2022-01-04 14:18:20 +0200
committerJoelHMikael <joel.h.kronqvist@gmail.com>2022-01-04 14:18:20 +0200
commite7b4d365f287f173c8cc0b5a4d965c3a0579c2e0 (patch)
treeb80769ee992b47aaa2aa56828880764531deaab6
parent2878bb666d1a2d1032683cd1783dbe6a9b505ba4 (diff)
downloadLYLLRuoka-e7b4d365f287f173c8cc0b5a4d965c3a0579c2e0.tar.gz
LYLLRuoka-e7b4d365f287f173c8cc0b5a4d965c3a0579c2e0.zip
Minor GUI improvements
-rw-r--r--index.css1
-rw-r--r--index.html2
-rw-r--r--scrape.js7
-rw-r--r--server.js2
4 files changed, 9 insertions, 3 deletions
diff --git a/index.css b/index.css
index d71e3f3..1f5a422 100644
--- a/index.css
+++ b/index.css
@@ -13,6 +13,7 @@ body {
background: #444;
color: white;
padding: 1em;
+ margin-bottom: 3em; /* for the footer */
font-family: verdana, sans-serif;
}
diff --git a/index.html b/index.html
index eba1547..c9f6c4c 100644
--- a/index.html
+++ b/index.html
@@ -8,7 +8,7 @@
</head>
<body>
<header>
- <h1>LYLL-ruokailuvuoro</h1>
+ <h1 class="shadow">LYLL-ruokailuvuoro</h1>
</header>
<br>
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(")", ")<br>").replaceAll(" :", ":").replaceAll(":", ":<br>");
+}
+
exports.food = scrapeFood;
exports.link = getFoodLink;
diff --git a/server.js b/server.js
index 2ed10fc..d26da04 100644
--- a/server.js
+++ b/server.js
@@ -178,7 +178,7 @@ async function buildMain(args)
// get the food
let food;
- food = foods[ +(day < actualDay) ][day]; // test this out more
+ food = foods[ +(day < actualDay) ][day];
if (food !== undefined)
{
res["food-header"] = food[0];