From 468e973630cb1114b52327922915fea2d177c3f2 Mon Sep 17 00:00:00 2001 From: Phillip Berndt Date: Mon, 12 Oct 2015 10:10:31 +0200 Subject: Neuer Comic: Erzaehlmirnix --- bin/comics/erzaehlmirnix | 31 +++++++++++++++++++++++++++++++ bin/gen.py | 7 ++++++- 2 files changed, 37 insertions(+), 1 deletion(-) create mode 100755 bin/comics/erzaehlmirnix 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 []" 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/" + }, } -- cgit v1.2.3-1-g7c22