Created
December 1, 2018 12:37
-
-
Save akhld/05e768387513d8035753d3410cc63971 to your computer and use it in GitHub Desktop.
Email scrapper
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cat urls | while read url; | |
do | |
curl -o- $url | grep -oh -i '[A-Z0-9._%+-]\+@[A-Z0-9.-]\+\.[A-Z]\{2,4\}' > emails; | |
email_found=`[[ $(wc -l < emails) -ge 1 ]] && echo "yes" || echo "no"`; | |
emails=`head -n3 emails | perl -00 -lpe 's/\n/,/g'`; | |
domain=`echo $url | awk -F[/:] '{print $4}'`; | |
more_emails=`[[ $(wc -l < emails) -ge 3 ]] && echo "yes" || echo "no"`; | |
echo "$domain, $email_found, $emails, $more_emails, $url"; | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment