From ca7b92dde2d7e7fc6f57609d99fd65012edb7eaa Mon Sep 17 00:00:00 2001 From: Martin Winkler Date: Sun, 10 Apr 2022 17:50:24 +0200 Subject: [PATCH] gcgetics.sh - Extract cids and ics links from google embedded calendars --- .editorconfig | 6 ++ README.md | 4 +- gcgetics.sh | 165 ++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 174 insertions(+), 1 deletion(-) create mode 100644 .editorconfig create mode 100755 gcgetics.sh diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..270aad7 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,6 @@ +root = true + +[*.sh] +charset = utf-8 +indent_style = space +indent_size = 2 diff --git a/README.md b/README.md index bd4be01..a18c66b 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ # icsutils -Tools to work with ics files in bash. \ No newline at end of file +Tools to work with ics files in bash. + +* `gcgetics.sh` : Extract google calender IDs and ICS links from given embedded google calendar diff --git a/gcgetics.sh b/gcgetics.sh new file mode 100755 index 0000000..510115b --- /dev/null +++ b/gcgetics.sh @@ -0,0 +1,165 @@ +#!/usr/bin/env bash + +# Author: Martin Winkler +# License: Please refer to the repository +# Origin: https://winklerfamilie.eu/git/SmallThings/icsutils.git + +# Exit on error. Append "|| true" if you expect an error. +set -o errexit +# Exit on error inside any functions or subshells. +set -o errtrace +# Do not allow use of undefined vars. Use ${VAR:-} to use an undefined VAR +set -o nounset +# Catch the error in case mysqldump fails (but gzip succeeds) in `mysqldump |gzip` +set -o pipefail + +# gc = google calendar +gc::getIcsUsage() { + cat </dev/null) && _sourced=1 +else # All other shells: examine $0 for known shell binary filenames + # Detects `sh` and `dash`; add additional shell filenames as needed. + case ${0##*/} in sh|dash) _sourced=1;; esac +fi +### + +if (( ! _sourced )); then + gc::getIcs "${@}" +fi +