diff --git a/src/calibre/web/feeds/recipes/__init__.py b/src/calibre/web/feeds/recipes/__init__.py index 1672796c9f..19c4f2827a 100644 --- a/src/calibre/web/feeds/recipes/__init__.py +++ b/src/calibre/web/feeds/recipes/__init__.py @@ -30,7 +30,7 @@ recipe_modules = ['recipe_' + r for r in ( 'honoluluadvertiser', 'starbulletin', 'exiled', 'indy_star', 'dna', 'pobjeda', 'chicago_breaking_news', 'glasgow_herald', 'linuxdevices', 'hindu', 'cincinnati_enquirer', 'physics_world', 'pressonline', - 'la_republica', + 'la_republica', 'physics_today', )] import re, imp, inspect, time, os diff --git a/src/calibre/web/feeds/recipes/recipe_physics_today.py b/src/calibre/web/feeds/recipes/recipe_physics_today.py new file mode 100644 index 0000000000..b0a583e4df --- /dev/null +++ b/src/calibre/web/feeds/recipes/recipe_physics_today.py @@ -0,0 +1,28 @@ +import re +from calibre.web.feeds.recipes import BasicNewsRecipe + +class Physicstoday(BasicNewsRecipe): + title = u'Physicstoday' + __author__ = 'Hypernova' + description = u'Physicstoday' + language = _('English') + oldest_article = 30 + max_articles_per_feed = 100 + no_stylesheets = True + use_embedded_content = False + 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')] + + def get_browser(self): + br = BasicNewsRecipe.get_browser() + if self.username is not None and self.password is not None: + br.open('http://www.physicstoday.org/pt/sso_login.jsp') + br.select_form(name='login') + br['username'] = self.username + br['password'] = self.password + br.submit() + return br