From de3ec1f4bcaaea8aa4085c3efb80e2c27ae141de Mon Sep 17 00:00:00 2001 From: nannal Date: Sat, 25 Jan 2020 13:59:41 +0200 Subject: [PATCH] Auto pushed --- script.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100755 script.sh diff --git a/script.sh b/script.sh new file mode 100755 index 0000000..8abacbe --- /dev/null +++ b/script.sh @@ -0,0 +1,18 @@ +#!/usr/bin/env bash +day=0 +function daysago(){ + day=$(date -d "$date -$1 days" +"%Y-%m-%d") +} + +i=0 +while [ $day != "1989-04-16" ] +do + daysago $i + echo $day + if [ ! -f ./imgs/$day.png ] + then + curl -sS https://dilbert.com/strip/$day|grep 'assets.amuniversal.com'|grep 'og:image'|cut -f 4 -d '"'|xargs curl -sS -o ./imgs/$day.png + fi + + i=$(($i+1)) +done