diff options
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/comics/calvin | 15 | ||||
-rwxr-xr-x | bin/comics/garfield | 19 | ||||
-rwxr-xr-x | bin/comics/snoopy | 28 | ||||
-rwxr-xr-x | bin/get-comics | 41 |
4 files changed, 67 insertions, 36 deletions
diff --git a/bin/comics/calvin b/bin/comics/calvin index e723747..e88ce87 100755 --- a/bin/comics/calvin +++ b/bin/comics/calvin @@ -5,19 +5,22 @@ tmp=$(mktemp -d) cd "${tmp}" newn="${day}.gif" -nomen=$(date -d "$daysago days ago" "+ch%y%m%d.gif") -server="http://picayune.uclick.com/comics/ch/$year/$nomen" +month="$(date -d "$daysago days ago" +%m)" +server="http://www.gocomics.com/calvinandhobbes/$year/$month/$day" + +nomen="$(wget ${wget_args} "$server" -O - | grep "class=\"strip\"" | \ + sed 's#.*<img alt="Calvin and Hobbes"[^<]*src="\([^"]*\)".*#\1#')" echo "Dateiname: $nomen" echo -echo "Hole c+h von $server" +echo "Hole calvinandhobbes von $server" echo "fuer Datum: $(date -d"$daysago days ago" -I)" echo -wget ${wget_args} "$server" +wget ${wget_args} "$nomen" -O "$newn" -if [ -e "${tmp}/${nomen}" ]; then - mv "${tmp}/${nomen}" "${image_dir}/$newn" +if [ -e "${tmp}/$newn}" ]; then + mv "${tmp}/${newn}" "${image_dir}/$newn" rm -f "${comic_dir}/latest.gif" ln -s "${image_offset}/$newn" "${comic_dir}/latest.gif" fi diff --git a/bin/comics/garfield b/bin/comics/garfield index 21ec88c..5707d04 100755 --- a/bin/comics/garfield +++ b/bin/comics/garfield @@ -1,23 +1,26 @@ #!/bin/bash source $(pwd)/$(dirname $0)/../../etc/settings.sh -tmp="$(mktemp -d)" +tmp=$(mktemp -d) cd "${tmp}" -gifname="ga$(date -d "$daysago days ago" +"%y%m%d").gif" -nomen="http://images.ucomics.com/comics/ga/$year/${gifname}" newn="${day}.gif" +month="$(date -d "$daysago days ago" +%m)" +server="http://www.gocomics.com/garfield/$year/$month/$day" -echo "Dateiname: $gifname" +nomen="$(wget ${wget_args} "$server" -O - | grep "class=\"strip\"" | \ + sed 's#.*<img alt="Garfield"[^<]*src="\([^"]*\)".*#\1#')" + +echo "Dateiname: $nomen" echo -echo "Hole garfield von $nomen" +echo "Hole garfield von $server" echo "fuer Datum: $(date -d"$daysago days ago" -I)" echo -wget ${wget_args} --user-agent=Mozilla "$nomen" +wget ${wget_args} "$nomen" -O "$newn" -if [ -e "${tmp}/${gifname}" ]; then - mv "${tmp}/${gifname}" "${image_dir}/$newn" +if [ -e "${tmp}/$newn}" ]; then + mv "${tmp}/${newn}" "${image_dir}/$newn" rm -f "${comic_dir}/latest.gif" ln -s "${image_offset}/$newn" "${comic_dir}/latest.gif" fi diff --git a/bin/comics/snoopy b/bin/comics/snoopy new file mode 100755 index 0000000..c4f8f78 --- /dev/null +++ b/bin/comics/snoopy @@ -0,0 +1,28 @@ +#!/bin/bash + +source $(pwd)/$(dirname $0)/../../etc/settings.sh +tmp=$(mktemp -d) +cd "${tmp}" + +newn="${day}.gif" +month="$(date -d "$daysago days ago" +%m)" +server="http://www.gocomics.com/peanuts/$year/$month/$day" + +nomen="$(wget ${wget_args} "$server" -O - | grep "class=\"strip\"" | \ + sed 's#.*<img alt="Peanuts"[^<]*src="\([^"]*\)".*#\1#')" + +echo "Dateiname: $nomen" +echo +echo "Hole snoopy von $server" +echo "fuer Datum: $(date -d"$daysago days ago" -I)" +echo + +wget ${wget_args} "$nomen" -O "$newn" + +if [ -e "${tmp}/$newn}" ]; then + mv "${tmp}/${newn}" "${image_dir}/$newn" + rm -f "${comic_dir}/latest.gif" + ln -s "${image_offset}/$newn" "${comic_dir}/latest.gif" +fi + +rm -rf "${tmp}" diff --git a/bin/get-comics b/bin/get-comics index 45be0ac..cc86ca1 100755 --- a/bin/get-comics +++ b/bin/get-comics @@ -1,32 +1,29 @@ -#!/usr/bin/zsh -if [[ "$1" = "--output" ]] -then - output=true - shift +#!/bin/sh + +if [ "$1" = "--output" ]; then + output=true + shift fi -if [[ "$1" = "" ]] -then - daysago=0 +if [ "$1" = "" ]; then + daysago=0 else - daysago=$1 + daysago=$1 fi myDate=$(date -Im --date "$daysago days ago") +dir="$(pwd)/$(dirname $0)/.." -cd /var/www/comics.spline.de # vielleicht tuts das einfach (Hendrik) -touch index.php3 +find ${dir}/htdocs/imgs -maxdepth 2 -name 'get' -type f \ + -executable -printf '%h\n' | while read i ; do -#old: for i in calvin garfield userfriendly touche dilbert claybennett zits nichtlustig; do + comic=$(basename $i) + if [ "$output" = "true" ]; then + ${i}/get $daysago + else + echo "---------------- $myDate ----------------" >> ${dir}/log/${comic}.log + ${i}/get $daysago >> ${dir}/log/${comic}.log 2>&1 & + fi -for i in calvin garfield touche dilbert claybennett zits nichtlustig xkcd userfriendly geekandpoke; do - if [[ "$output" = "true" ]] - then - $i/get$i $daysago - else - touch $i/$i.log - echo "---------------- $myDate ----------------" >> $i/$i.log - $i/get$i $daysago >>$i/$i.log 2>>$i/$i.log & - fi - sleep 2 + sleep 2 done |