Created
May 29, 2013 14:31
-
-
Save dep-deprecated/5670706 to your computer and use it in GitHub Desktop.
This script will pull a summary of unread messages from your gmail account.
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
#!/bin/sh | |
IFS=$'\n' | |
arrayEmail=(`curl -u username:password --silent "https://mail.google.com/mail/feed/atom" | sed -n '/<author>/,/<\/author>/p' | grep -a "email" | sed -e "s/\<email>//g">let Emails=${#arrayEmail[*]} | |
arraySubject=(`curl -u username:password --silent "https://mail.google.com/mail/feed/atom" | grep -a "title" | grep -v 'Gmail - Inbox for' | sed -e "s/\<title>//g" | s> | |
let Subjects=${#arraySubject[*]} | |
i=1 | |
m=0 | |
while [ $m -lt $Subjects ]; do | |
echo "${arrayEmail[$m]}" | |
echo "${arraySubject[$m]}" | |
echo | |
let m++ | |
let i++ | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment