Last active
January 4, 2016 15:19
-
-
Save joshtronic/8640234 to your computer and use it in GitHub Desktop.
Checks your unread message count on your Gmail account from the command line using OSX Keychain Access to store the credentials securely.
This file contains hidden or 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
export KEYCHAIN_ITEM='email' && curl -u `security find-generic-password -s ${KEYCHAIN_ITEM} | grep 'acct' | cut -c 19- | tr -d '"' | tr -d '\n'`:`security find-generic-password -w -s ${KEYCHAIN_ITEM}` --silent "https://mail.google.com/mail/feed/atom" | perl -ne 'print "$2\n" if /<(email)>(.*)<\/\1>/;' | wc -l | tr -d ' ' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment