-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathscrapeTech.sh
More file actions
43 lines (32 loc) · 742 Bytes
/
scrapeTech.sh
File metadata and controls
43 lines (32 loc) · 742 Bytes
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/bin/sh
# Date: 02-23-2015
# Description: Simple little shell bash shell script to scrape info on a site that's either using Google Analytics, or utilizing Dyn DNS.
function readUrl(){
read -p "Enter a URL: " url
}
function searchDns() {
dnsSearch=`whois $url | grep 'Name Server:' | grep -i dynect.net`
if [ "${dnsSearch}" ]; then
echo "Using Dyn: Yes"
else
echo "Using Dyn: No"
fi
}
function searchCurl() {
result=`curl -s $url | grep -F ".google-analytics.com/ga.js"`
result2=`curl -s $url | grep -F "ga.async = true"`
if [[ -n "$result" ]]; then
if [[ -n "$result2" ]]; then
echo "Using GA: Yes"
fi
else
echo "Using GA: No"
fi
}
function main(){
readUrl
searchCurl $url
searchDns $url
}
######### MAIN #######
main