Created
September 9, 2011 19:14
-
-
Save bollovan/1207072 to your computer and use it in GitHub Desktop.
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
#! /usr/bin/python2 | |
import os | |
import string | |
import urllib | |
#Enter your username and password below within double quotes | |
# eg. username="username" and password = "password" | |
username = "user" | |
password = "pass" | |
com = urllib.urlopen("https://" + username + ":" + password + "@mail.google.com/mail/feed/atom") | |
temp = com | |
msg = temp.read() | |
index = string.find(msg, "<fullcount>") | |
index2 = string.find(msg, "</fullcount>") | |
fc = int( msg[ index + 11:index2 ] ) | |
if fc == 0: | |
print "no new emails" | |
else: | |
print str(fc) + " new emails" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment