How can I check the number of unread Gmail message in my inbox with a short Python script? Bonus points for retrieving the password from a file.
Once you are logged in (do this manually or with gmail.py) you should use the feed.
It is located here: http://mail.google.com/mail/feed/atom
It is the way Google does it. Here is a link to their js chrome extension: http://dev.chromium.org/developers/design-documents/extensions/samples/gmail.zip
You will then be able to parse xml that looks like this:
Gmail - Inbox for yourmail@gmail.com
New messages in your Gmail Inbox
142