From 37366121f05df87a7af2f893e5cc2a69d97f5a68 Mon Sep 17 00:00:00 2001 From: Simon Rieger Date: Sat, 21 Sep 2024 18:17:37 +0200 Subject: [PATCH] add download script for pad download --- download_pads.sh | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100755 download_pads.sh diff --git a/download_pads.sh b/download_pads.sh new file mode 100755 index 0000000..7fbe3f0 --- /dev/null +++ b/download_pads.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +set -ex + +# Startdatum und Enddatum festlegen +start_date="2017-06-29" +end_date="2024-09-19" + +# Schleife über alle Daten im zweiwöchigen Rhythmus +current_date=$start_date +while [[ "$current_date" < "$end_date" ]]; do + # URL generieren + url="https://pad.stratum0.org/p/dc-$current_date/export/markdown" + + # Datei herunterladen und mit angepasstem Namen speichern + wget "$url" -O "dc-$current_date.md" + + # Datum um zwei Wochen erhöhen + current_date=$(date -I -d "$current_date + 14 days") +done