Skip to content

Instantly share code, notes, and snippets.

@Dannyzen
Created November 1, 2012 23:18
Show Gist options
  • Save Dannyzen/3997423 to your computer and use it in GitHub Desktop.
Save Dannyzen/3997423 to your computer and use it in GitHub Desktop.
for eric
import urllib2, feedparser
pwdmgr = urllib2.HTTPPasswordMgrWithDefaultRealm()
pwdmgr.add_password("New mail feed", 'http://mail.google.com/', username, password)
auth = urllib2.HTTPBasicAuthHandler(pwdmgr)
opener = urllib2.build_opener(auth)
data = opener.open('http://mail.google.com/mail/feed/atom')
d = feedparser.parse(data)
print d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment