From 9e56a06bc989b7c108a1db8c54fc2164e2d35c9d Mon Sep 17 00:00:00 2001 From: Thomas Lotze Date: Fri, 20 Oct 2023 00:13:30 +0200 Subject: [PATCH] calendar update script: put calendar URL in variable --- bin/calendar-events-exporter.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bin/calendar-events-exporter.sh b/bin/calendar-events-exporter.sh index 7ed5745..fc18807 100755 --- a/bin/calendar-events-exporter.sh +++ b/bin/calendar-events-exporter.sh @@ -1,5 +1,7 @@ #!/usr/bin/env bash -curl -sH "Accept: application/calendar+json" "https://cloud.kraut.space/remote.php/dav/public-calendars/2EkPGt3PF6WwYsA3?export&expand=1&start=$(date -d "" +%s)&end=$(date -d "next month" +%s)" \ +CAL_URL="https://cloud.kraut.space/remote.php/dav/public-calendars/2EkPGt3PF6WwYsA3?export&expand=1&start=$(date -d '' +%s)&end=$(date -d 'next month' +%s)" + +curl -sH "Accept: application/calendar+json" "${CAL_URL}" \ | jq -r '.[2] | map({_type: .[0]} + (.[1] | map({key: .[0], value: .[3]}) | from_entries))' \ > ./events.json