Quantcast
Channel: Active questions tagged atom-feed+feed+rss - Stack Overflow
Viewing all articles
Browse latest Browse all 47

Error accessing Gmail Atom feeds using feedparser

$
0
0

I was having a problem accessing my Gmail Atom feeds using feedparser module. For a non-password protected fees like a blog, for example,

import feedparser

d = feedparser.parse('http://karanjthakkar.wordpress.com/feed/')
print d.feed.title

The values that the feedparser module returned were correct. However when I used it using this to access my Gmail feed,

import urllib2, feedparser

def main():
 pwdmgr = urllib2.HTTPPasswordMgrWithDefaultRealm()
 pwdmgr.add_password("New mail feed", 'http://mail.google.com/', "karanjthakkar", "my-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

if __name__ == '__main__'
 main()

I got an Error 401 in the feed that was captured. This is what was captured:

screenshot

Am I missing something? I am not from a CS background so whatever I know is what I've read around. I intend to use the Gmail feeds captured to check the number of unread messages and display them using an Arduino.


Viewing all articles
Browse latest Browse all 47

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>