add --gattini flag

This commit is contained in:
encrypt 2016-04-11 12:33:01 +02:00
parent 778bf9df9d
commit 5526094029

View file

@ -1,5 +1,13 @@
#!/bin/bash
match=$(date +"%a" | tr '[:upper:]' '[:lower:]' | sed 's/mon/lunedi/;s/tue/martedi/;s/wed/mercoledi/;s/thu/giovedi/;s/fri/venerdi/;s/sat/sabato/;s/sun/domenica/')
day=$(date +"%a" | tr '[:upper:]' '[:lower:]' | sed 's/mon/lunedi/;s/tue/martedi/;s/wed/mercoledi/;s/thu/giovedi/;s/fri/venerdi/;s/sat/sabato/;s/sun/domenica/')
curl -s "http://immaginibuongiorno.it" | grep "$day" | grep -oP "(?<=src=\").*(?=\")" | cut -d '"' -f 1 | shuf -n 1
case $1 in
-g|--gattini)
match="gatto\|gattin\|micett"
;;
*)
;;
esac
curl -s "http://immaginibuongiorno.it" | grep "$match" | grep -oP "(?<=src=\").*(?=\")" | cut -d '"' -f 1 | shuf -n 1