From 3c05e850d5e0d503617553b1fdcb08717910a43f Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 18 Feb 2009 23:35:10 -0800 Subject: [PATCH] IGN:... --- .../web/feeds/recipes/recipe_physics_today.py | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/src/calibre/web/feeds/recipes/recipe_physics_today.py b/src/calibre/web/feeds/recipes/recipe_physics_today.py index b0a583e4df..a59e1bde34 100644 --- a/src/calibre/web/feeds/recipes/recipe_physics_today.py +++ b/src/calibre/web/feeds/recipes/recipe_physics_today.py @@ -1,10 +1,12 @@ import re -from calibre.web.feeds.recipes import BasicNewsRecipe +from calibre.web.feeds.news import BasicNewsRecipe class Physicstoday(BasicNewsRecipe): title = u'Physicstoday' - __author__ = 'Hypernova' - description = u'Physicstoday' + __author__ = 'Hypernova' + description = u'Physics Today magazine' + publisher = 'American Institute of Physics' + category = 'Physics' language = _('English') oldest_article = 30 max_articles_per_feed = 100 @@ -13,9 +15,12 @@ class Physicstoday(BasicNewsRecipe): needs_subscription = True remove_javascript = True remove_tags_before = dict(name='h1') - remove_tags_after = [dict(name='div', attrs={'id':'footer'})] - - feeds = [(u'All', u'http://www.physicstoday.org/feed.xml')] + remove_tags = [dict(name='div', attrs={'class':'highslide-footer'})] + remove_tags = [dict(name='div', attrs={'class':'highslide-header'})] + preprocess_regexps = [ + (re.compile(r'.*', re.DOTALL|re.IGNORECASE), + lambda match: ''), +] def get_browser(self): br = BasicNewsRecipe.get_browser() @@ -26,3 +31,5 @@ class Physicstoday(BasicNewsRecipe): br['password'] = self.password br.submit() return br + + feeds = [(u'All', u'http://www.physicstoday.org/feed.xml')] \ No newline at end of file