mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 18:54:09 -04:00
Updated recipe for New York Review of Books to use subscription based content
This commit is contained in:
parent
f4047dfdf1
commit
621c436edb
@ -17,9 +17,19 @@ class NewYorkReviewOfBooks(BasicNewsRecipe):
|
|||||||
description = u'Book reviews'
|
description = u'Book reviews'
|
||||||
language = _('English')
|
language = _('English')
|
||||||
__author__ = 'Kovid Goyal'
|
__author__ = 'Kovid Goyal'
|
||||||
|
needs_subscription = True
|
||||||
remove_tags_before = {'id':'container'}
|
remove_tags_before = {'id':'container'}
|
||||||
remove_tags = [{'class':['noprint', 'ad', 'footer']}, {'id':'right-content'}]
|
remove_tags = [{'class':['noprint', 'ad', 'footer']}, {'id':'right-content'}]
|
||||||
|
|
||||||
|
def get_browser(self):
|
||||||
|
br = BasicNewsRecipe.get_browser()
|
||||||
|
if self.username is not None and self.password is not None:
|
||||||
|
br.open('http://www.nybooks.com/register/')
|
||||||
|
br.select_form(name='login')
|
||||||
|
br['email'] = self.username
|
||||||
|
br['password'] = self.password
|
||||||
|
br.submit()
|
||||||
|
return br
|
||||||
|
|
||||||
def parse_index(self):
|
def parse_index(self):
|
||||||
root = html.fromstring(self.browser.open('http://www.nybooks.com/current-issue').read())
|
root = html.fromstring(self.browser.open('http://www.nybooks.com/current-issue').read())
|
||||||
@ -42,10 +52,4 @@ class NewYorkReviewOfBooks(BasicNewsRecipe):
|
|||||||
articles.append(article)
|
articles.append(article)
|
||||||
|
|
||||||
return [('Current Issue', articles)]
|
return [('Current Issue', articles)]
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user