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
320B

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