added fetch_gaidao.sh

This commit is contained in:
tastytea 2018-06-11 07:04:27 +02:00
parent 7b9fae8c44
commit bf9c16a46a
Signed by: tastytea
GPG Key ID: 59346E0EA35C67E5
2 changed files with 21 additions and 4 deletions

View File

@ -1,4 +1,5 @@
| Script | Description |
| ---------: |:-------------------------------------------------------------- |
| urlhandler | Open URLs based on regular expressions. |
| yt2mpd.sh | Adds an Youtube video to MPD, with correct title and duration. |
| Script | Description |
| --------------: |:-------------------------------------------------------------- |
| urlhandler | Open URLs based on regular expressions. |
| yt2mpd.sh | Adds an Youtube video to MPD, with correct title and duration. |
| fetch_gaidao.sh | Auf neue Ausgaben von der Gai Dao prüfen, herunterladen. |

16
fetch_gaidao.sh Normal file
View File

@ -0,0 +1,16 @@
#!/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