#!/bin/bash

set -xe

export PATH=$PATH:~/go/bin/

xkcd="$(curl --silent -L xkcd.com |pup --color 'img json{}'  |jq -r '.[] | .src' |grep comics |head -n 1)"
if ! echo "$xkcd" |grep -qE '^https';then
	xkcd=https:"$xkcd"
fi
wget "$xkcd" -O xkcd.png


smbc="$(curl --silent -L https://www.smbc-comics.com/ |pup --color 'img json{}' |jq -r '.[] | .src' |grep /comics/ |grep -v after |head -n 1)"
wget "$smbc" -O smbc.png

