Skip to content

Instantly share code, notes, and snippets.

@dep-deprecated
Created May 29, 2013 14:31
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 dep-deprecated/5670706 to your computer and use it in GitHub Desktop.
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.
#!/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