View Single Post
Old 10-25-2011, 10:59 PM   #4
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,449
Karma: 27757438
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Login code will be in the next release. For the curious:

Code:
    needs_subscription = 'optional'
    def get_browser(self):
        br = BasicNewsRecipe.get_browser(self)
        if self.username and self.password:
            br.open('http://www.theaustralian.com.au')
            br.select_form(nr=0)
            br['username'] = self.username
            br['password'] = self.password
            raw = br.submit().read()
            if '>log out' not in raw.lower():
                raise ValueError('Failed to log in to www.theaustralian.com.au'
                        ' are your username and password correct?')
        return br
kovidgoyal is offline   Reply With Quote