Last active
September 19, 2017 14:46
-
-
Save tastytea/4b6a31576af21e4aa1fb490322940415 to your computer and use it in GitHub Desktop.
Auf neue Ausgaben von der Gai Dao prüfen, herunterladen
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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