#test that the parser is working
#@TeCoEd

import feedparser
import time

DEBUG = 1

USERNAME = "enter your username"     # just the part before the @ sign, add yours here
PASSWORD = "enter your password"     

NEWMAIL_OFFSET = 1      # my unread messages never goes to zero, yours might
check_emails = 10       # check mail every 60 seconds

while True:

        newmails = int(feedparser.parse("https://" + USERNAME + ":" + PASSWORD +"@mail.google.com/gmail/feed/atom")["feed"]["fullcount"])

        if DEBUG:
                print "You have", newmails, "new emails!"

        if newmails > NEWMAIL_OFFSET:
                print "new mail"
        else:
                "no mail"

        time.sleep(check_emails)

