Update The Federalist

This commit is contained in:
Kovid Goyal 2022-03-08 07:41:14 +05:30
parent 7080d8914b
commit cbbac1be62
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -16,27 +16,31 @@ class Federalist(BasicNewsRecipe):
title = 'The Federalist' title = 'The Federalist'
__author__ = 'Kovid Goyal' __author__ = 'Kovid Goyal'
language = 'en' language = 'en'
oldest_article = 7 oldest_article = 10
max_articles_per_feed = 100 max_articles_per_feed = 100
no_stylesheets = True no_stylesheets = True
encoding = 'utf-8' encoding = 'utf-8'
use_embedded_content = False use_embedded_content = False
remove_attributes = ['xmlns', 'lang', 'style', 'width', 'height'] 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 = [ keep_only_tags = [
classes('entry-header'), classes(
classes('wp-post-image post-categories entry-content shortbio byline-month byline-standard alpha-byline'), '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 = [ remove_tags = [
dict(name=['meta', 'link']), 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 = [ feeds = [
('All', 'http://thefederalist.com/feed/'), ('All', 'https://thefederalist.com/feed/'),
] ]
def preprocess_html(self, soup): def preprocess_html(self, soup):
@ -49,9 +53,3 @@ class Federalist(BasicNewsRecipe):
img.extract() img.extract()
seen.add(src) seen.add(src)
return soup 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/'},
# ])]