mirror of
				https://github.com/kovidgoyal/calibre.git
				synced 2025-11-03 19:17:02 -05:00 
			
		
		
		
	Update New York Times Book Review
This commit is contained in:
		
							parent
							
								
									b37a78fd89
								
							
						
					
					
						commit
						4d89815a6e
					
				@ -1,20 +1,19 @@
 | 
			
		||||
 | 
			
		||||
from calibre.web.feeds.news import BasicNewsRecipe
 | 
			
		||||
 | 
			
		||||
class NewYorkTimesBookReview(BasicNewsRecipe):
 | 
			
		||||
    title          = u'New York Times Book Review'
 | 
			
		||||
    language       = 'en'
 | 
			
		||||
    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.'
 | 
			
		||||
    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
 | 
			
		||||
    __author__     = 'Kovid Goyal'
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    no_stylesheets = True
 | 
			
		||||
    no_javascript = True
 | 
			
		||||
    keep_only_tags = [dict(id='article'), dict(id=lambda x:x and x.startswith('entry-'))]
 | 
			
		||||
    remove_tags = [
 | 
			
		||||
        dict(attrs={'class':['articleBottomExtra', 'shareToolsBox', 'singleAd']}),
 | 
			
		||||
        dict(attrs={'class':lambda x: x and ('shareTools' in x or 'enlargeThis' in x)}),
 | 
			
		||||
    ]
 | 
			
		||||
    auto_cleanup = True
 | 
			
		||||
    #keep_only_tags = [dict(id='article'), dict(id=lambda x:x and x.startswith('entry-'))]
 | 
			
		||||
    # remove_tags = [
 | 
			
		||||
        #dict(attrs={'class':['articleBottomExtra', 'shareToolsBox', 'singleAd']}),
 | 
			
		||||
        #dict(attrs={'class':lambda x: x and ('shareTools' in x or 'enlargeThis' in x)}),
 | 
			
		||||
    #]
 | 
			
		||||
 | 
			
		||||
    def parse_index(self):
 | 
			
		||||
        soup = self.index_to_soup('http://www.nytimes.com/pages/books/review/index.html')
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user