summaryrefslogtreecommitdiff
path: root/meetup/gen_dates.sh
diff options
context:
space:
mode:
Diffstat (limited to 'meetup/gen_dates.sh')
-rwxr-xr-xmeetup/gen_dates.sh26
1 files changed, 23 insertions, 3 deletions
diff --git a/meetup/gen_dates.sh b/meetup/gen_dates.sh
index 0bc4479..6e73c02 100755
--- a/meetup/gen_dates.sh
+++ b/meetup/gen_dates.sh
@@ -6,11 +6,13 @@
LIMIT=3
# uncomment to enable debug
-#DEBUG=1
+DEBUG=0
# where to put the output files?
NEXT_FILE="next.html"
AFTER_FILE="after.html"
+STANDARD_FILE="standard.html"
+TECHCORE_FILE="techcore.html"
DOW=`date +"%u"`
if [ $DOW -eq 1 ]; then
@@ -22,13 +24,20 @@ else
fi
MEETUPS=""
+MEETUPTYPES=""
CNT=0
while true; do
if [ -n "$DEBUG" ]; then echo -n "check day($TS): "`date --date="@$TS" +"%d.%m.%Y"`; fi
if [ $DOM -le 7 ] || ([ $DOM -ge 15 ] && [ $DOM -le 21 ]); then
- if [ -n "$DEBUG" ]; then echo " -> ok"; fi
+ if [ $DOM -le 7 ]; then
+ MTYP="Tech/Core"
+ else
+ MTYP="gemütliches"
+ fi
+ if [ -n "$DEBUG" ]; then echo " -> ok $MTYP"; fi
MEETUPS="$MEETUPS $TS"
+ MEETUPTYPES="$MEETUPTYPES $MTYP"
CNT=$((CNT + 1))
if [ $CNT -ge $LIMIT ]; then
break;
@@ -45,11 +54,22 @@ NEXT=$1
shift
FUTURE=$@
+set -- $MEETUPTYPES
+NEXTMTYP=$1
+shift
+FUTUREMTYP=$@
+
date --date="@$NEXT" +"%d.%m.%Y" > "$NEXT_FILE.new"
+CNT=0
echo "<ul>" > "$AFTER_FILE.new"
for meetup in $FUTURE; do
- echo " <li>"`date --date="@$meetup" +"%d.%m.%Y"`"</li>" >> "$AFTER_FILE.new"
+ set -- $FUTUREMTYP
+ mtext=$1
+ shift
+ FUTUREMTYP=$@
+ echo " <li>"`date --date="@$meetup" +"%d.%m.%Y"`": $mtext Treffen </li>" >> "$AFTER_FILE.new"
+ CNT=$((CNT + 1))
done
echo "</ul>" >> "$AFTER_FILE.new"
mv "$NEXT_FILE.new" "$NEXT_FILE"