added fetch_gaidao.sh
This commit is contained in:
parent
7b9fae8c44
commit
bf9c16a46a
|
@ -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. |
|
||||
|
|
|
@ -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
|
Loading…
Reference in New Issue