summaryrefslogtreecommitdiffstats
path: root/bin/comics/touche
diff options
context:
space:
mode:
Diffstat (limited to 'bin/comics/touche')
-rwxr-xr-xbin/comics/touche31
1 files changed, 31 insertions, 0 deletions
diff --git a/bin/comics/touche b/bin/comics/touche
new file mode 100755
index 0000000..07e6f15
--- /dev/null
+++ b/bin/comics/touche
@@ -0,0 +1,31 @@
+#!/bin/bash
+
+source $(pwd)/$(dirname $0)/../../etc/settings.sh
+tmp=$(mktemp -d)
+cd "${tmp}"
+
+newn="${day}.gif"
+useragent="Mozilla/4.76 [de] (X11; U; Linux 2.2.18 i586)"
+
+pfad=$(date --date "$daysago days ago 2h" +dx/.1/gif.t,tom.d,%s)
+pfad2=$(date --date "$daysago days ago" +dx/%Y/%m/%d.1/tomcartoon)
+
+echo "Dateiname: $newn"
+echo
+echo "Hole snoopy von www.taz.de/$pfad"
+echo "mit Referer: http://www.taz.de/$pfad2"
+echo "fuer Datum: $(date -d"$daysago days ago" -I)"
+echo
+wget ${wget_args} -U "$useragent" \
+ --header="Referer: http://www.taz.de/$pfad2" \
+ -O "$newn" http://www.taz.de/$pfad
+
+if [ -s "$newn" ]; then
+ if file "$newn" | grep GIF > /dev/null 2>&1; then
+ mv "${tmp}/${newn}" "${image_dir}/$newn"
+ rm -f "${comic_dir}/latest.gif"
+ ln -s "${image_offset}/$newn" "${comic_dir}/latest.gif"
+ fi
+fi
+
+rm -rf "${tmp}"