summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhillip Berndt <pberndt@spline.de>2014-05-13 10:24:49 +0200
committerPhillip Berndt <pberndt@spline.de>2015-05-20 09:33:12 +0200
commitaf74d43f2849e80fac95a1eb002693c64106cd7d (patch)
tree345bf98bb487b40e35d3616360955bd7fd42ee34
parent5540f747361cd950b588e54e61c53697a11526fc (diff)
downloadcomics-af74d43f2849e80fac95a1eb002693c64106cd7d.tar.gz
comics-af74d43f2849e80fac95a1eb002693c64106cd7d.tar.bz2
comics-af74d43f2849e80fac95a1eb002693c64106cd7d.zip
Added new comic: Extra Fabulous Comics
-rwxr-xr-xbin/comics/extrafabulous44
-rwxr-xr-xbin/gen.py5
2 files changed, 49 insertions, 0 deletions
diff --git a/bin/comics/extrafabulous b/bin/comics/extrafabulous
new file mode 100755
index 0000000..9b70f78
--- /dev/null
+++ b/bin/comics/extrafabulous
@@ -0,0 +1,44 @@
+#!/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}"
+
+export LANG=C
+export LC_ALL=C
+
+DATE=$(date -d"$daysago days ago" +"%d %b %Y")
+
+URL=$(wget "http://extrafabulouscomics.com/feed/" -O - | sed -n -re "/pubDate.+$DATE/ { n; n; n; n; s/.+(http:\/\/extrafabulouscomics.com\/comic\/[0-9]+\/).+/\1/p; q }")
+
+if [ -z $URL ]; then
+ echo "Nichts gefunden für $DATE"
+ exit 0
+fi
+echo URL $URL gefunden
+
+URL=$(wget -O - "$URL" | sed -nre 's#.*<img src="(http://extrafabulouscomics.com/wp-content/[^"]+)".+#\1#p')
+
+if [ -z $URL ]; then
+ echo "Comic URL nicht gefunden!!"
+ exit 1
+fi
+echo Comic URL $URL
+
+
+wget -O "${tmp}/${day}.gif" $URL
+
+if [ -s "${tmp}/${day}.gif" ]; then
+ mv "${tmp}/${day}.gif" "${image_dir}/${day}.gif"
+ ln -s "${image_dir}/${day}.gif" "${comic_dir}/latest.gif"
+fi
+
+rm -rf "${tmp}"
diff --git a/bin/gen.py b/bin/gen.py
index e64b9ad..e52af96 100755
--- a/bin/gen.py
+++ b/bin/gen.py
@@ -97,6 +97,11 @@ comics = {
"imageformat": "png",
"url": "http://jeremykaye.tumblr.com/"
},
+ "extrafabulous": {
+ "name": "Extra Fabulous Comics",
+ "imageformat": "gif",
+ "url": "http://extrafabulouscomics.com/"
+ }
}