2018-06-11 07:04:27 +02:00
|
|
|
#!/bin/sh
|
2019-07-02 19:24:36 +02:00
|
|
|
# Auf neue Ausgaben von der Gai Dao prüfen, herunterladen
|
2018-06-11 07:04:27 +02:00
|
|
|
|
2019-07-02 19:24:36 +02:00
|
|
|
cd ~/Documents/Zeitungen/Gaidao || exit 1
|
2020-09-17 19:39:15 +02:00
|
|
|
|
2019-07-19 22:15:19 +02:00
|
|
|
ausgaben=$(curl -s https://fda-ifa.org/gaidao/ausgaben/ \
|
2020-09-17 19:39:15 +02:00
|
|
|
| grep -Eo 'https://fda-ifa.org/[^"]*\.epub' \
|
|
|
|
| head -n 5)
|
2018-06-11 07:04:27 +02:00
|
|
|
|
2020-09-17 19:39:15 +02:00
|
|
|
for url in ${ausgaben}; do
|
|
|
|
file=$(basename "${url}")
|
2019-07-22 15:02:42 +02:00
|
|
|
if [ -n "${file}" ] && [ ! -e "${file}" ]; then
|
2019-07-02 19:24:36 +02:00
|
|
|
echo "Downloading Gai Dao: ${file}."
|
2019-07-19 22:15:19 +02:00
|
|
|
curl -so "${file}" "${url}"
|
2019-07-02 19:24:36 +02:00
|
|
|
fi
|
2018-06-11 07:04:27 +02:00
|
|
|
done
|