summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhillip Berndt <pberndt@spline.de>2015-10-12 10:10:31 +0200
committerPhillip Berndt <pberndt@spline.de>2015-10-12 10:11:15 +0200
commit468e973630cb1114b52327922915fea2d177c3f2 (patch)
tree2db71065a4479bac046697c5d2185d6d4e70dc47
parent78772fbebff9cc6325f7a712fc835fabafaa3e3e (diff)
downloadcomics-468e973630cb1114b52327922915fea2d177c3f2.tar.gz
comics-468e973630cb1114b52327922915fea2d177c3f2.tar.bz2
comics-468e973630cb1114b52327922915fea2d177c3f2.zip
Neuer Comic: Erzaehlmirnix
-rwxr-xr-xbin/comics/erzaehlmirnix31
-rwxr-xr-xbin/gen.py7
2 files changed, 37 insertions, 1 deletions
diff --git a/bin/comics/erzaehlmirnix b/bin/comics/erzaehlmirnix
new file mode 100755
index 0000000..229c2d8
--- /dev/null
+++ b/bin/comics/erzaehlmirnix
@@ -0,0 +1,31 @@
+#!/bin/bash
+
+if [ -z "$1" -o ! -d "$1" ]; then
+ echo "Usage: $0 <top-directory> [<days ago>]" 1>&2
+ exit 1
+fi
+
+top="${1}"
+shift
+
+source "${top}/etc/settings.sh"
+tmp="$(mktemp -d)"
+cd "${tmp}"
+
+webaddress="https://erzaehlmirnix.wordpress.com/$(date -d"$daysago days ago" +%Y/%m/%d)"
+grepurl="https://erzaehlmirnix.files.wordpress.com/$(date -d"$daysago days ago" +%Y/%m)"
+newn="${day}.png"
+
+echo "Search $webaddress"
+STRIP=$(curl -L "$webaddress" | grep -oE ${grepurl}'/[^"]+' | head -n1)
+echo "Strip URL $STRIP"
+
+if [ -n "$STRIP" ]; then
+ wget ${wget_args} "$STRIP" -O erzaehlmirnix.png
+ mv "erzaehlmirnix.png" "${image_dir}/$newn"
+ rm -f "${comic_dir}/latest.png"
+ ln -s "${image_offset}/$newn" "${comic_dir}/latest.png"
+fi
+
+cd ..
+rm -rf "${tmp}"
diff --git a/bin/gen.py b/bin/gen.py
index f37c877..d074361 100755
--- a/bin/gen.py
+++ b/bin/gen.py
@@ -106,7 +106,12 @@ comics = {
"name": "MANvsMAGIC",
"imageformat": "png",
"url": "http://www.manvsmagic.com/"
- }
+ },
+ "erzaehlmirnix": {
+ "name": "Erzaehlmirnix",
+ "imageformat": "png",
+ "ul": "https://erzaehlmirnix.wordpress.com/"
+ },
}