Browse Source

Add ia-cdx-search-subdomains

master
JustAnotherArchivist 1 year ago
parent
commit
1830d67283
1 changed files with 15 additions and 0 deletions
  1. +15
    -0
      ia-cdx-search-subdomains

+ 15
- 0
ia-cdx-search-subdomains View File

@@ -0,0 +1,15 @@
#!/bin/bash
set -euo pipefail

if [[ $# -eq 0 || "$1" == '-h' || "$1" == '--help' ]]
then
echo "Usage: ia-cdx-search-subdomains [OPTIONS] DOMAIN" >&2
echo "Extracts all known subdomains from IA's CDX API, printing unique subdomains to stdout" >&2
echo "Any options are passed through to ia-cdx-search; use this to customise parallelism or resume after errors" >&2
exit 1
fi

domain="${@: -1}"
set -- "${@:1:$(($#-1))}"
scriptpath="$(cd "$(dirname "$0")"; pwd -P)"
"${scriptpath}/ia-cdx-search" "$@" "url=${domain}&collapse=urlkey&fl=original&matchType=domain" | grep -o '^[^/]*//[^/]*' | sed 's,^.*/,,; s,:[0-9]\+$,,' | "${scriptpath}/uniqify"

Loading…
Cancel
Save