Guest User

Alexa Top 1000 Sites Using Google Email Service

a guest
Aug 26th, 2014
325
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.97 KB | None | 0 0
  1. #!/bin/bash
  2. # Count the number of sites in Alexa Top 1000 who are using Google Email MX records
  3. #
  4. # As of Aug 27, the numbers are
  5. # Sites Using googlemail        221
  6. # Sites NOT using googlemail        779
  7. #
  8. #
  9. # 1 Download the topsites.txt file from here
  10. # 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
  11. #
  12. # 2 make this file executeable "chmod +x this-file.sh"
  13. #
  14. # 3 From the command line: './this.file.sh > output.txt'
  15.  
  16. GOOGLECOUNT=0
  17. OTHERCOUNT=0
  18.  
  19. for DOMAIN in `cat ./topsites.txt`; do
  20.     CMD='host -t mx '$DOMAIN
  21.     RESULT=`eval $CMD`
  22.     #echo ' '$RESULT
  23.     if [[ $RESULT == *google.com* ]]
  24.     then
  25.     LENGTH=`echo $DOMAIN|wc -c`
  26.         echo $DOMAIN',1'
  27.         GOOGLECOUNT=`expr $GOOGLECOUNT + 1`
  28.     else
  29.         echo $DOMAIN',0'
  30.         OTHERCOUNT=`expr $OTHERCOUNT + 1`
  31.     fi
  32. done
  33. echo '#Sites Using googlemail       '$GOOGLECOUNT
  34. echo '#Sites NOT using googlemail   '$OTHERCOUNT
Add Comment
Please, Sign In to add comment