From cbbac1be62acbd88060895f98f8caaa865195dc7 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 8 Mar 2022 07:41:14 +0530 Subject: [PATCH] Update The Federalist --- recipes/the_federalist.recipe | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/recipes/the_federalist.recipe b/recipes/the_federalist.recipe index 89f8cc4317..2a9d66a9e0 100644 --- a/recipes/the_federalist.recipe +++ b/recipes/the_federalist.recipe @@ -16,27 +16,31 @@ class Federalist(BasicNewsRecipe): title = 'The Federalist' __author__ = 'Kovid Goyal' language = 'en' - oldest_article = 7 + oldest_article = 10 max_articles_per_feed = 100 no_stylesheets = True encoding = 'utf-8' use_embedded_content = False remove_attributes = ['xmlns', 'lang', 'style', 'width', 'height'] - extra_css = ''' - .shortbio { margin: 1em; padding: 1em; font-style: italic } - ''' + + extra_css = """ + .shortbio,.article-excerpt{font-style: italic} + .article-author-details,.article-author-description,.article-meta-author,.article-meta-date,.article-thumbnail-caption{font-size: small} + """ keep_only_tags = [ - classes('entry-header'), - classes('wp-post-image post-categories entry-content shortbio byline-month byline-standard alpha-byline'), + classes( + 'title-lg post-categories article-excerpt article-author-details' + ' article-meta-author article-meta-date article-content article-body shortbio entry-header' + ' byline-month byline-standard alpha-byline article-author-description article-author-details'), ] remove_tags = [ dict(name=['meta', 'link']), - classes('auth-ad attachment-post-thumbnail attachment-author-bio'), + classes('auth-ad article-share article-tags attachment-post-thumbnail attachment-author-bio'), ] feeds = [ - ('All', 'http://thefederalist.com/feed/'), + ('All', 'https://thefederalist.com/feed/'), ] def preprocess_html(self, soup): @@ -49,9 +53,3 @@ class Federalist(BasicNewsRecipe): img.extract() seen.add(src) return soup - - # def parse_index(self): - # return [('Articles', [ - # {'title':'img', 'url':'http://thefederalist.com/2018/05/09/venezuelas-economic-problems-caused-socialism-not-falling-oil-prices/'}, - # {'title':'xxx', 'url':'http://thefederalist.com/2018/05/04/fans-take-on-marvel-dc-and-the-comic-book-industrys-sjw-self-destruction/'}, - # ])]