summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhillip Berndt <pberndt@spline.de>2013-10-28 07:56:23 +0100
committerPhillip Berndt <pberndt@spline.de>2015-05-20 09:33:11 +0200
commite230df2a862c193d3d1939aa6af7503600953ffa (patch)
treef8387a2f4b013304577e29c2a457f311f1cc2e2e
parent87787a99091ef927692138227c4f1d1830a086cf (diff)
downloadcomics-e230df2a862c193d3d1939aa6af7503600953ffa.tar.gz
comics-e230df2a862c193d3d1939aa6af7503600953ffa.tar.bz2
comics-e230df2a862c193d3d1939aa6af7503600953ffa.zip
New comic: SMBC
-rwxr-xr-xbin/comics/smbc27
-rwxr-xr-xbin/gen.py5
2 files changed, 32 insertions, 0 deletions
diff --git a/bin/comics/smbc b/bin/comics/smbc
new file mode 100755
index 0000000..a83e242
--- /dev/null
+++ b/bin/comics/smbc
@@ -0,0 +1,27 @@
+#!/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
+export LC_TIME=C
+
+wget ${wget_args} -O "$day.png" "http://www.smbc-comics.com/comics/`date -d "$daysago days ago 00:00:00" +%Y%m%d`.png"
+
+if [ -s "${day}.png" ]; then
+ mv ${day}.png "${image_dir}/$day.png"
+ rm -f "${comic_dir}/latest.png"
+ ln -s "${image_offset}/$day.png" "${comic_dir}/latest.png"
+fi
+
+rm -rf "${tmp}"
diff --git a/bin/gen.py b/bin/gen.py
index 8565499..45bc473 100755
--- a/bin/gen.py
+++ b/bin/gen.py
@@ -82,6 +82,11 @@ comics = {
"imageformat": "gif",
"url": "http://www.phdcomics.com/comics/archive.php"
},
+ "smbc": {
+ "name": "SMBC",
+ "imageformat": "png",
+ "url": "http://www.smbc-comics.com/index.php"
+ },
}