Thread: gmail recipe
View Single Post
Old 09-26-2010, 02:55 AM   #1
marbs
Zealot
marbs began at the beginning.
 
Posts: 122
Karma: 10
Join Date: Jul 2010
Device: nook
gmail recipe

i am trying to make a gmail recipe. the address is https://mail.google.com/gmail/feed/atom/. i was thinking it ould be a good idea to logon through https://www.google.com/accounts/Logi...ww.google.com/ and then download the feed. it works in a regular browser when i do it. not working in python. any ideas?

Spoiler:
Code:
from calibre.web.feeds.news import BasicNewsRecipe

class AdvancedUserRecipe1285454835(BasicNewsRecipe):
    title          = u'test1'
    __author__            = 'marbs'
    oldest_article = 7
    max_articles_per_feed = 100
    needs_subscription = True
    feeds          = [(u'test', u'https://mail.google.com/gmail/feed/atom/')]

    LOGIN = 'https://www.google.com/accounts/Login?hl=en&continue=http://www.google.com/'

    def get_browser(self):
        br = BasicNewsRecipe.get_browser()
        if self.username is not None and self.password is not None:
            br.open(self.LOGIN)
            br.select_form(id='gaia_loginform')
            br['Email'] = self.username
            br['passwd'] = self.password
            br.submit()
        return br
marbs is offline   Reply With Quote