The little things give you away... A collection of various small helper stuff
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.
 
 
 

16 lines
649 B

  1. #!/bin/bash
  2. set -euo pipefail
  3. if [[ $# -eq 0 || "$1" == '-h' || "$1" == '--help' ]]
  4. then
  5. echo "Usage: ia-cdx-search-subdomains [OPTIONS] DOMAIN" >&2
  6. echo "Extracts all known subdomains from IA's CDX API, printing unique subdomains to stdout" >&2
  7. echo "Any options are passed through to ia-cdx-search; use this to customise parallelism or resume after errors" >&2
  8. exit 1
  9. fi
  10. domain="${@: -1}"
  11. set -- "${@:1:$(($#-1))}"
  12. scriptpath="$(cd "$(dirname "$0")"; pwd -P)"
  13. "${scriptpath}/ia-cdx-search" "$@" "url=${domain}&collapse=urlkey&fl=original&matchType=domain" | grep -o '^[^/]*//[^/"]*' | sed 's,^.*/,,; s,:[0-9]\+$,,' | "${scriptpath}/uniqify"