Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # Count the number of sites in Alexa Top 1000 who are using Google Email MX records
- #
- # As of Aug 27, the numbers are
- # Sites Using googlemail 221
- # Sites NOT using googlemail 779
- #
- #
- # 1 Download the topsites.txt file from here
- # curl -s -O http://s3.amazonaws.com/alexa-static/top-1m.csv.zip ; unzip -q -o top-1m.csv.zip top-1m.csv ; head -1000 top-1m.csv | cut -d, -f2 | cut -d/ -f1 > topsites.txt
- #
- # 2 make this file executeable "chmod +x this-file.sh"
- #
- # 3 From the command line: './this.file.sh > output.txt'
- GOOGLECOUNT=0
- OTHERCOUNT=0
- for DOMAIN in `cat ./topsites.txt`; do
- CMD='host -t mx '$DOMAIN
- RESULT=`eval $CMD`
- #echo ' '$RESULT
- if [[ $RESULT == *google.com* ]]
- then
- LENGTH=`echo $DOMAIN|wc -c`
- echo $DOMAIN',1'
- GOOGLECOUNT=`expr $GOOGLECOUNT + 1`
- else
- echo $DOMAIN',0'
- OTHERCOUNT=`expr $OTHERCOUNT + 1`
- fi
- done
- echo '#Sites Using googlemail '$GOOGLECOUNT
- echo '#Sites NOT using googlemail '$OTHERCOUNT
Add Comment
Please, Sign In to add comment