tfixed color highlighting - canteen-info - scrape weekly menus from canteens su… | |
git clone git://src.adamsgaard.dk/canteen-info | |
Log | |
Files | |
Refs | |
README | |
LICENSE | |
--- | |
commit 614864e850e4265d5dc2f873179c76062560d025 | |
parent 03828869089738c2e2f68dbddf4fd0219ddf9e62 | |
Author: Anders Damsgaard <[email protected]> | |
Date: Thu, 19 Feb 2015 12:13:01 +0100 | |
fixed color highlighting | |
Diffstat: | |
M canteeninfo.sh | 34 +++++++++++++++--------------… | |
1 file changed, 16 insertions(+), 18 deletions(-) | |
--- | |
diff --git a/canteeninfo.sh b/canteeninfo.sh | |
t@@ -1,6 +1,20 @@ | |
#!/bin/bash | |
out=/tmp/canteeninfo.html | |
+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 | |
+ | |
echo -n "<!DOCTYPE html> | |
<html> | |
<head> | |
t@@ -62,21 +76,5 @@ echo -n "<!DOCTYPE html> | |
<a href='mailto:[email protected]'>Anders</a></p> | |
<a href='https://github.com/anders-dc/canteen-info'>Source code</a></p> | |
</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 | |
+</html>" |\ | |
+ sed "s/${highlight}/<font color='red'>${highlight}<\/font>/g" > $out |