mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 02:34:06 -04:00
Update The Federalist
This commit is contained in:
parent
7080d8914b
commit
cbbac1be62
@ -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/'},
|
||||
# ])]
|
||||
|
Loading…
x
Reference in New Issue
Block a user