summaryrefslogtreecommitdiffstats
path: root/bin/comics/nichtlustig
blob: f8037c44cf88259cb7632b98718e37ce341b4042 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/bin/bash
source $(pwd)/$(dirname $0)/../../etc/settings.sh
tmp="$(mktemp -d)"
cd "${tmp}"

browser="Mozilla/4.06 [en] (X11; I; Linux 2.0.35 i586)"
date="$(date -d"$daysago days ago" +%y%m%d)"
imgname="${date}.jpg"
nomen="http://static.nichtlustig.de/comics/full/${imgname}"
newn="${day}.jpg"

echo "Dateiname: $imgname"
echo
echo "Hole nichtlustig von $nomen"
echo "fuer Datum: $(date -d"$daysago days ago" -I)"
echo
wget ${wget_args} --header="Referer: http://static.nichtlustig.de/toondb/${date}.html" \
    --user-agent="$browser" "$nomen"

if [ -s "${tmp}/${imgname}" ]; then
    mv "${tmp}/${imgname}" "${image_dir}/$newn"
    rm -f "${comic_dir}/latest.jpg"
    ln -s "${image_offset}/$newn" "${comic_dir}/latest.jpg"
fi

rm -rf "${tmp}"