~ubuntu-branches/debian/sid/calibre/sid

« back to all changes in this revision

Viewing changes to recipes/nytimesbook.recipe

  • Committer: Package Import Robot
  • Author(s): Martin Pitt
  • Date: 2014-02-27 07:48:06 UTC
  • mto: This revision was merged to the branch mainline in revision 74.
  • Revision ID: package-import@ubuntu.com-20140227074806-64wdebb3ptosxhhx
Tags: upstream-1.25.0+dfsg
ImportĀ upstreamĀ versionĀ 1.25.0+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
 
2
1
from calibre.web.feeds.news import BasicNewsRecipe
3
2
 
4
3
class NewYorkTimesBookReview(BasicNewsRecipe):
5
4
    title          = u'New York Times Book Review'
6
5
    language       = 'en'
7
 
    description    = 'The New York Times Sunday Book Review. Best downloaded on Fridays to avoid the ads that the New York Times shows of the first few days of the week.'
 
6
    description    = 'The New York Times Sunday Book Review. Best downloaded on Fridays to avoid the ads that the New York Times shows of the first few days of the week.'  # noqa
8
7
    __author__     = 'Kovid Goyal'
9
8
 
10
 
 
11
9
    no_stylesheets = True
12
10
    no_javascript = True
13
 
    keep_only_tags = [dict(id='article'), dict(id=lambda x:x and x.startswith('entry-'))]
14
 
    remove_tags = [
15
 
        dict(attrs={'class':['articleBottomExtra', 'shareToolsBox', 'singleAd']}),
16
 
        dict(attrs={'class':lambda x: x and ('shareTools' in x or 'enlargeThis' in x)}),
17
 
    ]
 
11
    auto_cleanup = True
 
12
    #keep_only_tags = [dict(id='article'), dict(id=lambda x:x and x.startswith('entry-'))]
 
13
    # remove_tags = [
 
14
        #dict(attrs={'class':['articleBottomExtra', 'shareToolsBox', 'singleAd']}),
 
15
        #dict(attrs={'class':lambda x: x and ('shareTools' in x or 'enlargeThis' in x)}),
 
16
    #]
18
17
 
19
18
    def parse_index(self):
20
19
        soup = self.index_to_soup('http://www.nytimes.com/pages/books/review/index.html')