From 8af795d9dd34ce97bfa9ca3f07afd3553f64ff9d Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 21 Mar 2010 06:58:02 +0530 Subject: [PATCH] Fix NYTimes --- resources/recipes/nytimes_sub.recipe | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/resources/recipes/nytimes_sub.recipe b/resources/recipes/nytimes_sub.recipe index c126902899..78f6016c94 100644 --- a/resources/recipes/nytimes_sub.recipe +++ b/resources/recipes/nytimes_sub.recipe @@ -31,7 +31,7 @@ class NYTimes(BasicNewsRecipe): # List of sections to exclude # To add a section, copy the section name from the allSectionKeywords list above # For example, to exclude 'Dining' and 'Weddings': - # excludeSectionKeywords = ['Dining','Weddings'] + #excludeSectionKeywords = ['Dining','Weddings'] excludeSectionKeywords = [] # List of sections to include (test and debug only) @@ -56,9 +56,12 @@ class NYTimes(BasicNewsRecipe): remove_tags_before = dict(id='article') remove_tags_after = dict(id='article') remove_tags = [dict(attrs={'class':[ + 'articleFooter', + 'articleInline runaroundLeft', 'articleTools', 'columnGroup doubleRule', 'columnGroup last', + 'columnGroup last', 'doubleRule', 'dottedLine', 'entry-meta', @@ -70,6 +73,7 @@ class NYTimes(BasicNewsRecipe): 'relatedSearchesModule', 'side_tool', 'singleAd', + 'subNavigation tabContent active clearfix', ]}), dict(id=[ 'adxLeaderboard', @@ -222,11 +226,11 @@ class NYTimes(BasicNewsRecipe): if div['class'] == 'section-headline': key = string.capwords(feed_title(div)) - excluded = re.compile('|'.join(self.excludeSectionKeywords)) - if excluded.search(key): - self.log("Skipping section %s" % key) - continue - + if len(self.excludeSectionKeywords): + excluded = re.compile('|'.join(self.excludeSectionKeywords)) + if excluded.search(key): + self.log("Skipping section %s" % key) + continue articles[key] = [] ans.append(key)