Skip to content

Instantly share code, notes, and snippets.

@douglas-larocca
Forked from saml/gmailexists.sh
Created May 5, 2018 07:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save douglas-larocca/7aa8ffb32af414fe7c1e6adba139ad47 to your computer and use it in GitHub Desktop.
Save douglas-larocca/7aa8ffb32af414fe7c1e6adba139ad47 to your computer and use it in GitHub Desktop.
gmail exists
#!/bin/bash
if (( $# < 1 ))
then
echo "Usage: $0 username"
exit 1
fi
username="$1"
json_left='{"input01":{"Input":"GmailAddress","GmailAddress":"'
json_right='","FirstName":"","LastName":""},"Locale":"en"}'
json="$json_left$username$json_right"
echo "$json"
output=$(curl -s -f -X POST -H 'Content-Type: application/json; charset=UTF-8' -d "$json" 'https://accounts.google.com/InputValidator?resource=signup&service=mail')
echo "$output"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment