diff options
-rwxr-xr-x | bin/comics/erzaehlmirnix | 31 | ||||
-rwxr-xr-x | bin/gen.py | 7 |
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}" @@ -106,7 +106,12 @@ comics = { "name": "MANvsMAGIC", "imageformat": "png", "url": "http://www.manvsmagic.com/" - } + }, + "erzaehlmirnix": { + "name": "Erzaehlmirnix", + "imageformat": "png", + "ul": "https://erzaehlmirnix.wordpress.com/" + }, } |