View Single Post
Old 08-22-2012, 09:11 AM   #9
lrui
Enthusiast
lrui ought to be getting tired of karma fortunes by now.lrui ought to be getting tired of karma fortunes by now.lrui ought to be getting tired of karma fortunes by now.lrui ought to be getting tired of karma fortunes by now.lrui ought to be getting tired of karma fortunes by now.lrui ought to be getting tired of karma fortunes by now.lrui ought to be getting tired of karma fortunes by now.lrui ought to be getting tired of karma fortunes by now.lrui ought to be getting tired of karma fortunes by now.lrui ought to be getting tired of karma fortunes by now.lrui ought to be getting tired of karma fortunes by now.
 
lrui's Avatar
 
Posts: 49
Karma: 475062
Join Date: Aug 2012
Device: nook simple touch
Quote:
Originally Posted by flightonair View Post
Could you share me the code and the procedure how to auto login? I'm a newbie for Calibre receipe. I love read infzm very week, but it cannot automatically fetch the articles to my kindle 3 device.

Thanks.
Code:
needs_subscription = True
def get_browser(self):
        br = BasicNewsRecipe.get_browser(self)
        if self.username is not None and self.password is not None:
            cookies = mechanize.CookieJar()
            br = mechanize.build_opener(mechanize.HTTPCookieProcessor(cookies))
            request = urllib.urlencode([('loginname', self.username), ('password', self.password),])
            response = br.open('http://passport.infzm.com/passport/login', request)
        return br

Last edited by lrui; 08-22-2012 at 09:46 AM.
lrui is offline   Reply With Quote