-
Notifications
You must be signed in to change notification settings - Fork 5
/
govalue.sh
25 lines (21 loc) · 1.2 KB
/
govalue.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/bin/sh
value () {
echo -e "Enter the domain, & hit Enter\n"
while read dom; do
echo -e "The value of ${dom} is USD $(curl -s "https://api.godaddy.com/v1/appraisal/${dom}" | jq '.govalue') \n Please proceed with the next\n\n"
done </dev/tty
}
# Find value of individual domains with value ()
bulk_value () {
declare -i wait=10
declare -i ctr=1
while read dom; do
data=$(curl -s "https://api.godaddy.com/v1/appraisal/${dom}" -H "Authorization: sso-key $GDkey:$GDsecret")
if [ "$(echo $data | jq '.message')" != "null" ]; then
echo -e "\nWe hit the rate limit, so slowing down for $(( wait*ctr ))s\n"; sleep $(( wait * ctr )); echo -e "\nStarting bulk search, if its still unreliable, end the process, wait for longer, then continue\n"; ((ctr++));
else
echo -e "The value of ${dom} is USD $(echo $data | jq '.govalue') \n" >> $(echo $1 | cut -d '.' -f 1)-value.txt; sleep $2;
fi
done < $1
}
# Find value from a list of domains (.txt) file, pasted one after the other line by line (delimited by newline)