summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhillip Berndt <pberndt@spline.de>2015-02-02 08:39:10 +0100
committerPhillip Berndt <pberndt@spline.de>2015-05-20 09:33:12 +0200
commit6e27103acde41a180d725b29a8f3e8be6025911c (patch)
tree81702ea4501ddab5135e1c6c6b129c98eb45a087
parentdb3cf50e15f85452a71d9e321c459ac1a5642aef (diff)
downloadcomics-6e27103acde41a180d725b29a8f3e8be6025911c.tar.gz
comics-6e27103acde41a180d725b29a8f3e8be6025911c.tar.bz2
comics-6e27103acde41a180d725b29a8f3e8be6025911c.zip
Cyanide and Happiness fixed yet again
-rwxr-xr-xbin/comics/cyanide11
1 files changed, 6 insertions, 5 deletions
diff --git a/bin/comics/cyanide b/bin/comics/cyanide
index cb20267..969a44d 100755
--- a/bin/comics/cyanide
+++ b/bin/comics/cyanide
@@ -16,25 +16,26 @@ export LANG=C
export LC_ALL=C
export LC_TIME=C
year=`date -d "$daysago days ago 00:00:00" +%Y`
-month=`date -d "$daysago days ago 00:00:00" +%B`
+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/" | grep -oE "${month}.+</table>" | sed -nre "s#.+href=\"([^\"]+)\">[^/]+${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}"
exit
fi
-htmladdress="http://explosm.net/$part"
+htmladdress="http://explosm.net/comics/$part"
echo "Cyanide and happyness: $htmladdress gefunden"
browser="Mozilla/4.06 [en] (X11; I; Linux 2.0.35 i586)"
echo "Lese URL von $htmladdress"
-url=$(wget ${wget_args} -O - --user-agent="$browser" "$htmladdress" | grep -oE 'http://www.explosm.net/db/files/Comics/[^"]+')
+url=$(wget ${wget_args} -O - --user-agent="$browser" "$htmladdress" | grep -oE 'files.explosm.net/comics/[^"]+' | head -n1)
-if [ -n $url ]; then
+if [ -n "$url" ]; then
+ url="http://$url"
echo "Dateiname: $url"
echo "Hole cyanide and happyness für Datum: $(date -d"$daysago days ago" -I)"