You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

17 lines
320 B

2 years ago
#!/usr/bin/env bash
set -e
while getopts ":t:d:" opt; do
case "$opt" in
t) TYPE="$OPTARG" ;;
d) DATE="$OPTARG" ;;
esac
done
shift "$((OPTIND-1))"
: ${TYPE:=fractals}
: ${DATE:="$(date "+%Y%m%d")"}
URL="https://imirhil.fr/gw2/$TYPE"
curl -s "$URL/" | sed -n "s#.*href=\"\(.*\)\">.*#$URL/\1#p" | rg "$DATE"