Skip to content

Instantly share code, notes, and snippets.

@jgamblin
Created September 17, 2019 15:05
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jgamblin/a9f2ef27c78dfe3e5e65645fe9d1b970 to your computer and use it in GitHub Desktop.
Save jgamblin/a9f2ef27c78dfe3e5e65645fe9d1b970 to your computer and use it in GitHub Desktop.
Check a List Of Emails For Open Google Calendars.
#!/usr/bin/env bash
# Check a List Of Emails For Open Google Calendars.
if [[ $# -eq 0 ]]; then
echo 'Please provide a list email addresses to check.'
exit 1
fi
email_list="$1"
for email_address in $(cat $email_list); do
status=$(curl -s -o /dev/null -w "%{http_code}" "https://calendar.google.com/calendar/htmlembed?src=$email_address" 2> /dev/null )
if [ "$status" = 200 ]; then
printf "%s" "$email_address"
printf "\n"
else
:
fi
done < "$email_list"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment