Skip to content

Instantly share code, notes, and snippets.

@tastytea
Last active September 19, 2017 14:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tastytea/4b6a31576af21e4aa1fb490322940415 to your computer and use it in GitHub Desktop.
Save tastytea/4b6a31576af21e4aa1fb490322940415 to your computer and use it in GitHub Desktop.
Auf neue Ausgaben von der Gai Dao prüfen, herunterladen
#!/bin/sh
# Auf neue Ausgaben von der Gai Dao prüfen, herunterladen
cd ~/Documents/Zeitungen/Gaidao
ausgaben="$(curl -s https://fda-ifa.org/gaidao/ausgaben/ \
| grep -Eo 'https://fda-ifa.org/gai-?dao-(nr-)?[0-9]+-[^/]*/')"
for ausgabe in ${ausgaben}; do
url="$(curl -s ${ausgabe} \
| grep -Eo 'https://fda-ifa.org/wp-content/uploads/[0-9]{4}/[0-9]{2}/[^ ]*\.epub')"
file="$(echo ${url} | grep -o '[^/]*\.epub')"
if [ ! -e ${file} ]; then
echo "Downloading Gai Dao: ${file}."
curl -so ${file} ${url}
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment