Created
December 26, 2023 14:49
-
-
Save KrustyHack/b669396d8f41e386128a87549d04829d to your computer and use it in GitHub Desktop.
Script to call Domdetailer API and check root domain and www
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Check if parameter is empty | |
if [ -z "$1" ] | |
then | |
echo "Please provide a domain name" | |
exit 1 | |
fi | |
temp_file=$(mktemp) | |
api_key="XXX" | |
curl "https://domdetailer.com/api/checkDomain.php?apikey=$api_key&app=manual&domain=$1" -L --silent |jq 'del(.domainAsEntered, .mozLinks, .mozPA, .mozDA, .mozRank, .mozTrust, .mozSpam, .majesticStatReturned, .stumbles, .majesticTTF0Value, .majesticTTF1Value, .majesticTTF2Value)' | jq -c '.' >> "$temp_file" | |
curl "https://domdetailer.com/api/checkDomain.php?apikey=$api_key&app=manual&domain=www.$1" -L --silent |jq 'del(.domainAsEntered, .mozLinks, .mozPA, .mozDA, .mozRank, .mozTrust, .mozSpam, .majesticStatReturned, .stumbles, .majesticTTF0Value, .majesticTTF1Value, .majesticTTF2Value)' | jq -c '.' >> "$temp_file" | |
jtbl < "$temp_file" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Example :