Skip to content

Instantly share code, notes, and snippets.

@KrustyHack
Created December 26, 2023 14:49
Show Gist options
  • Save KrustyHack/b669396d8f41e386128a87549d04829d to your computer and use it in GitHub Desktop.
Save KrustyHack/b669396d8f41e386128a87549d04829d to your computer and use it in GitHub Desktop.
Script to call Domdetailer API and check root domain and www
#!/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"
@KrustyHack
Copy link
Author

KrustyHack commented Dec 26, 2023

Example :

$: domdetailer simple.game
╒═══════════╤═════════════╤═════════════╤═════════════╤═════════════╤═════════════╤═════════════╤═════════════╤═════════════╤═════════════╤═════════════╤═════════════╤═════════════╤═════════════╤═════════════╕
│ domain    │   FB_commen │   FB_shares │   pinterest │   majesticL │   majesticR │   majesticR │   majesticR │   majesticR │   majesticI │   majesticC │ majesticT   │ majesticT   │ majesticT   │   majesticT │
│           │          ts │             │       _pins │        inks │   efDomains │       efEDU │       efGov │   efSubnets │          Ps │           F │ TF0Name     │ TF1Name     │ TF2Name     │           F │
╞═══════════╪═════════════╪═════════════╪═════════════╪═════════════╪═════════════╪═════════════╪═════════════╪═════════════╪═════════════╪═════════════╪═════════════╪═════════════╪═════════════╪═════════════╡
│ simple.ga │           0 │          17 │           0 │        1083 │         364 │           0 │          27 │         176 │         228 │          26 │ Home/Gard   │ Games/Onl   │ Games/Vid   │           8 │
│ me        │             │             │             │             │             │             │             │             │             │             │ ening       │ ine         │ eo Games/   │             │
│           │             │             │             │             │             │             │             │             │             │             │             │             │ News and    │             │
│           │             │             │             │             │             │             │             │             │             │             │             │             │ Reviews     │             │
├───────────┼─────────────┼─────────────┼─────────────┼─────────────┼─────────────┼─────────────┼─────────────┼─────────────┼─────────────┼─────────────┼─────────────┼─────────────┼─────────────┼─────────────┤
│ www.simpl │           0 │           1 │           0 │        1083 │         364 │           0 │          27 │         176 │         228 │          26 │ Home/Gard   │ Games/Onl   │ Games/Vid   │           8 │
│ e.game    │             │             │             │             │             │             │             │             │             │             │ ening       │ ine         │ eo Games/   │             │
│           │             │             │             │             │             │             │             │             │             │             │             │             │ News and    │             │
│           │             │             │             │             │             │             │             │             │             │             │             │             │ Reviews     │             │
╘═══════════╧═════════════╧═════════════╧═════════════╧═════════════╧═════════════╧═════════════╧═════════════╧═════════════╧═════════════╧═════════════╧═════════════╧═════════════╧═════════════╧═════════════╛

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment