tadd highlighting of current day - canteen-info - scrape weekly menus from cant… | |
git clone git://src.adamsgaard.dk/canteen-info | |
Log | |
Files | |
Refs | |
README | |
LICENSE | |
--- | |
commit 03828869089738c2e2f68dbddf4fd0219ddf9e62 | |
parent 09aae846a120cf387339ddd6845151d17a0d5fcc | |
Author: Anders Damsgaard <[email protected]> | |
Date: Thu, 19 Feb 2015 12:08:00 +0100 | |
add highlighting of current day | |
Diffstat: | |
M canteeninfo.sh | 16 ++++++++++++++++ | |
1 file changed, 16 insertions(+), 0 deletions(-) | |
--- | |
diff --git a/canteeninfo.sh b/canteeninfo.sh | |
t@@ -64,3 +64,19 @@ echo -n "<!DOCTYPE html> | |
</body> | |
</html>" > $out | |
+weekday=$(date +%A) | |
+highlight="1234567890asdfasdf" | |
+if [[ "$weekday" == "Monday" ]]; then | |
+ highlight="Mandag" | |
+elif [[ "$weekday" == "Tuesday" ]]; then | |
+ highlight "Tirsdag" | |
+elif [[ "$weekday" == "Wednesday" ]]; then | |
+ highlight="Onsdag" | |
+elif [[ "$weekday" == "Thursday" ]]; then | |
+ highlight="Torsdag" | |
+elif [[ "$weekday" == "Friday" ]]; then | |
+ highlight="Fredag" | |
+fi | |
+ | |
+# Highlight current weekday | |
+cat $out | sed "s/${highlight}/<font color='red'>${highlight}<\/font>/g" > $out |