summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhillip Berndt <pberndt@fob.spline.inf.fu-berlin.de>2016-06-28 14:50:49 +0200
committerPhillip Berndt <pberndt@fob.spline.inf.fu-berlin.de>2016-06-28 14:50:49 +0200
commit597527698d9bc2d52e05b4335c5f7cc52867c306 (patch)
tree76f0653f4221d2bf9c404914f521a3d9b33343db
parent468e973630cb1114b52327922915fea2d177c3f2 (diff)
downloadcomics-597527698d9bc2d52e05b4335c5f7cc52867c306.tar.gz
comics-597527698d9bc2d52e05b4335c5f7cc52867c306.tar.bz2
comics-597527698d9bc2d52e05b4335c5f7cc52867c306.zip
Fixed several comics
-rwxr-xr-xbin/comics/MANvsMAGIC46
-rwxr-xr-xbin/comics/claybennett15
-rwxr-xr-xbin/comics/cyanide2
-rwxr-xr-xbin/comics/jeremykaye39
-rwxr-xr-xbin/comics/smbc23
-rwxr-xr-xbin/comics/zits4
6 files changed, 15 insertions, 114 deletions
diff --git a/bin/comics/MANvsMAGIC b/bin/comics/MANvsMAGIC
deleted file mode 100755
index a1aa77c..0000000
--- a/bin/comics/MANvsMAGIC
+++ /dev/null
@@ -1,46 +0,0 @@
-#!/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}"
-
-browser="Mozilla/4.76 [de] (X11; U; Linux 2.2.18 i586)"
-
-TARGET_URL=$(wget ${wget_args} -q -U "$browser" "http://www.manvsmagic.com/archive/" -O - | sed -nre "s#.+href=\"(/`date -d "$daysago days ago" +%Y/%m/%d`/[^\"]+)\".+#\1#p")
-newn="${day}.png"
-
-if [ -n "$TARGET_URL" ]; then
- echo "Found $TARGET_URL"
- wget ${wget_args} -U "$browser" http://www.manvsmagic.com$TARGET_URL -q -O index.html
-
- IMG_URL=`sed -nre 's#.+img src="(/images/[^"]+)".+#\1#p' index.html`
- if [ -n "$IMG_URL" ]; then
- IMG_URL=http://www.manvsmagic.com$IMG_URL
- ALT=`sed -nre 's#.+img src="/images.+alt="([^"]+).+#\1#p' index.html`
-
- echo "Img is $IMG_URL"
- echo "Alt is $ALT"
-
- wget ${wget_args} -U "$browser" -O "${tmp}/${newn}" --header="Referer: http://www.manvsmagic.com/" "$IMG_URL"
-
- if [ -s "${tmp}/${newn}" ]; then
- mv "${tmp}/${newn}" "${image_dir}/$newn"
- echo "$ALT" > "${image_dir}/${day}.alt"
-
- # update symlinks
- rm -f "${comic_dir}/latest.png" "${comic_dir}/latest.title" "${comic_dir}/latest.alt"
- ln -s "${image_offset}/$newn" "${comic_dir}/latest.png"
- ln -s "${image_offset}/${day}.alt" "${comic_dir}/latest.alt"
- fi
- fi
-fi
-
-rm -rf ${tmp}
diff --git a/bin/comics/claybennett b/bin/comics/claybennett
index 3ea8ed3..b698b39 100755
--- a/bin/comics/claybennett
+++ b/bin/comics/claybennett
@@ -13,21 +13,10 @@ tmp="$(mktemp -d)"
cd "${tmp}"
export LC_ALL=C
-date="$(date -d "$daysago days ago" +"%a, %d %b %Y")"
+date="$(date -d "$daysago days ago" +"%Y/%b/%d/" | tr "[:upper:]" "[:lower:]")"
newn="${day}.jpg"
-# get post link
-rss="http://www.timesfreepress.com/rss/headlines/opinion/cartoons/"
-rss_regex="<pubDate>${date}[^<]*</pubDate><guid>[^<]*</guid>"
-url_regex=".*<guid>\([^<]*\)</guid>.*"
-
-post=$(wget ${wget_args} -O - "${rss}" | grep "${rss_regex}" | sed "s#${url_regex}#\1#")
-
-if [ -n "${post}" ]; then
- # get img url from post
- img=$(wget ${wget_args} -O - "${post}" | grep '<div class="story_lead_photo">' -A 3 | \
- sed -n 's#.*<img.*src="\([^"]*\)".*#\1#p')
-fi
+img=$(wget ${wget_args} -O - "http://www.timesfreepress.com/cartoons/" | grep -A 1 -E "/cartoons/${date}[^\"]+\">" | sed -nre 's#.+src=\"([^\"]+).+#\1#p' | head -1)
if [ -n "${img}" ]; then
echo "Hole claybennett von $server"
diff --git a/bin/comics/cyanide b/bin/comics/cyanide
index 969a44d..90e536d 100755
--- a/bin/comics/cyanide
+++ b/bin/comics/cyanide
@@ -19,7 +19,7 @@ year=`date -d "$daysago days ago 00:00:00" +%Y`
month=`date -d "$daysago days ago 00:00:00" +%m`
day=`date -d "$daysago days ago 00:00:00" +%d`
-part=`curl -s "http://explosm.net/comics/archive/$year/$month" | sed -nre "s#.+/comics/([0-9]+)\">$year.$month.$day.+#\1#p"`
+part=`curl -s "http://explosm.net/comics/archive/$year/$month" | sed -nre "s#.+/comics/([0-9]+)/?\">$year.$month.$day.+#\1#p"`
if [ -z "$part" ]; then
echo "Cyanide and Happyness: Kein Comic für $year, $month $day"
rm -rf "${tmp}"
diff --git a/bin/comics/jeremykaye b/bin/comics/jeremykaye
deleted file mode 100755
index abe0150..0000000
--- a/bin/comics/jeremykaye
+++ /dev/null
@@ -1,39 +0,0 @@
-#!/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}"
-
-export LC_ALL=C
-
-searchdate="$(date -d "$daysago days ago" "+%b %d, %Y")"
-
-echo "searching on $searchdate"
-
-posturl="$(wget -O - http://jeremykaye.tumblr.com/archive | sed -nre "s#.*(http://[^\"]+)\">.+post_date\">${searchdate}.*#\1#p")"
-
-echo "post url: $posturl"
-
-if [ -n "$posturl" ]; then
- read URL TITLE <<EOF
-$(wget -O - "$posturl" | sed -nre "s#.*img src=\"(http://.+media.tumblr.com/[^\"]+.png)\" *alt=\"(.+)#\1 \2#p")
-EOF
- echo "url: $URL"
- echo "title: $TITLE"
- wget ${wget_args} --header="Referer: $posturl" -O "${day}.png" $URL
- if [ -s "${tmp}/${day}.png" ]; then
- mv "${tmp}/${day}.png" "${image_dir}/${day}.png"
- rm -f "${comic_dir}/latest.png"
- ln -s "${image_offset}/${day}.png" "${comic_dir}/latest.png"
- fi
-fi
-
-rm -rf "${tmp}"
diff --git a/bin/comics/smbc b/bin/comics/smbc
index ff5a305..344ef6a 100755
--- a/bin/comics/smbc
+++ b/bin/comics/smbc
@@ -16,29 +16,26 @@ export LANG=C
export LC_ALL=C
export LC_TIME=C
-SEARCH_DATE=`date -d "$daysago days ago 00:00:00" +%b.%d.%y`
-CID=`wget ${wget_args} -O - "http://www.smbc-comics.com/archives.php" | grep -oE 'value="([^"]+)">'$SEARCH_DATE | sed -nre 's#value="([^"]+).+#\1#p' | head -n1`
+SEARCH_DATE=`date -d "$daysago days ago 00:00:00" +"%B %d, %Y"`
-if [ -n "$CID" ]; then
- echo "CID is '$CID'"
- COMIC_LINE=`wget ${wget_args} -O - "http://www.smbc-comics.com/index.php?id="$CID | grep 'id="comicbody"'`
- echo "Comic line is $COMIC_LINE"
+echo Search for: $SEARCH_DATE
- COMIC_URL=`sed -nre 's#.+src="(comics/.+.png)".+#\1#p' <<<$COMIC_LINE`
- COMIC_TITLE=`sed -nre 's#.+title="([^"]+)".+#\1#p' <<<$COMIC_LINE`
+SYM=$(wget ${wget_args} -O - "http://www.smbc-comics.com/comic/archive" | sed -nre "s#.+<option value=\"([^\"]+)\">${SEARCH_DATE}.+#\1#p")
+echo Symlink: $SYM
- echo " url is $COMIC_URL"
- echo " title is $COMIC_TITLE"
+if [ -n "$SYM" ]; then
- if [ -n $COMIC_URL ]; then
- wget ${wget_args} -O "$day.png" http://www.smbc-comics.com/$COMIC_URL
+ IMG=$(wget ${wget_args} -O - "http://www.smbc-comics.com/comic/${SYM}" | sed -nre 's#.+src="(http://www.smbc-comics.com/comics/[^"]+).+#\1#p')
+
+ if [ -n "$IMG" ]; then
+ wget ${wget_args} -O "$day.png" "$IMG"
if [ -s "${day}.png" ]; then
mv ${day}.png "${image_dir}/$day.png"
- echo "$COMIC_TITLE" > "${image_dir}/$day.title"
rm -f "${comic_dir}/latest.png"
ln -s "${image_offset}/$day.png" "${comic_dir}/latest.png"
fi
fi
+
fi
echo "tmp"
diff --git a/bin/comics/zits b/bin/comics/zits
index b3399ce..2455002 100755
--- a/bin/comics/zits
+++ b/bin/comics/zits
@@ -16,8 +16,8 @@ export LC_ALL=C
newn="${day}.gif"
month="$(date -d "$daysago days ago" +%m)"
-server="http://zitscomics.com/comics/$(date -d "$daysago days ago" +%B-%-d-%Y | tr '[:upper:]' '[:lower:]')/"
-imgregex="http://safr.kingfeatures.com/idn/etv/zone/xml/content.php\?file=[A-Za-z0-9]+"
+server="http://zitscomics.com/comics/$(date -d "$daysago days ago" +%B-%d-%Y | tr '[:upper:]' '[:lower:]')/"
+imgregex="https://safr.kingfeatures.com/idn/[^\?]+/content.php\?file=[A-Za-z0-9]+"
useragent="Mozilla/4.76 [de] (X11; U; Linux 2.2.18 i586)"
echo "Dateiname: $newn"