Skip to content

Instantly share code, notes, and snippets.

View dep-deprecated's full-sized avatar

danny peck dep-deprecated

  • Asheville, NC
View GitHub Profile
@dep-deprecated
dep-deprecated / Gmail Unread
Created May 29, 2013 14:31
This script will pull an 'unread count' from your gmail inbox.
#!/usr/bin/env python -tt
import sys
import curses
import imaplib
import warnings
def main():
imap_server = imaplib.IMAP4_SSL("imap.gmail.com",993)
imap_server.login('username', 'password')
imap_server.select('INBOX')
@dep-deprecated
dep-deprecated / Gmail Summary
Created May 29, 2013 14:31
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