This commit is contained in:
Kovid Goyal 2020-02-24 06:54:09 +05:30
commit 7a28607260
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 33 additions and 28 deletions

View File

@ -6,50 +6,55 @@ abc.net.au/news
import re import re
from calibre.web.feeds.recipes import BasicNewsRecipe from calibre.web.feeds.recipes import BasicNewsRecipe
class ABCNews(BasicNewsRecipe): class ABCNews(BasicNewsRecipe):
title = 'ABC News' title = 'ABC News'
__author__ = 'Pat Stapleton, Dean Cording' __author__ = 'Pat Stapleton, Dean Cording, James Cridland'
description = 'News from Australia' description = 'From the Australian Broadcasting Corporation. The ABC is owned and funded by the Australian Government, but is editorially independent.'
masthead_url = 'http://www.abc.net.au/news/assets/v5/images/common/logo-news.png' masthead_url = 'https://www.abc.net.au/cm/lb/8212706/data/news-logo-2017---desktop-print-data.png'
cover_url = 'http://www.abc.net.au/news/assets/v5/images/common/logo-news.png' cover_url = 'https://www.abc.net.au/news/linkableblob/8413676/data/abc-news-og-data.jpg'
cover_margins = (0,20,'#000000')
oldest_article = 2 oldest_article = 2
max_articles_per_feed = 100 handle_gzip = True
no_stylesheets = False no_stylesheets = True
use_embedded_content = False use_embedded_content = False
scale_news_images_to_device = True
encoding = 'utf8' encoding = 'utf8'
publisher = 'ABC News' publisher = 'ABC News'
category = 'News, Australia, World' category = 'Australia,News'
language = 'en_AU' language = 'en_AU'
publication_type = 'newsportal' publication_type = 'newspaper'
# preprocess_regexps = [(re.compile(r'<!--.*?-->', re.DOTALL), lambda m: '')] extra_css = '.byline{font-size:smaller;margin-bottom:10px;}.inline-caption{display:block;font-size:smaller;text-decoration: none;}'
# Remove annoying map links (inline-caption class is also used for some
# image captions! hence regex to match maps.google)
preprocess_regexps = [(re.compile( preprocess_regexps = [(re.compile(
r'<a class="inline-caption" href="http://maps\.google\.com.*?/a>', re.DOTALL), lambda m: '')] r'<a class="inline-caption" href="http://maps\.google\.com.*?/a>', re.DOTALL), lambda m: '')] # Remove map links
conversion_options = { conversion_options = {
'comments': description, 'tags': category, 'language': language, 'publisher': publisher, 'linearize_tables': False 'comments': description, 'tags': category, 'language': language, 'publisher': publisher, 'linearize_tables': False
} }
keep_only_tags = [dict(attrs={'class': ['article section']})] keep_only_tags = [dict(attrs={'class': ['article section']})]
remove_tags = [dict(attrs={'class': ['related', 'tags', 'tools', 'attached-content ready', remove_tags = [dict(attrs={'class': ['inner', 'attached-content', 'authorpromo', 'related', 'tags', 'tools', 'attached-content ready',
'inline-content story left', 'inline-content map left contracted', 'published', 'inline-content story left', 'inline-content map left contracted',
'inline-content full embedYouTube embedded', 'published',
'story-map', 'statepromo', 'topics', ]})] 'story-map', 'statepromo', 'topics', ]})]
#inner = key points
#attached-content = related stories
#authorpromo = "Contact NameOfJournalist"
remove_attributes = ['width', 'height'] remove_attributes = ['width', 'height']
feeds = [ feeds = [
('Top Stories', 'http://www.abc.net.au/news/feed/45910/rss.xml'), ('Top Stories', 'https://www.abc.net.au/news/feed/45910/rss.xml'),
('Canberra', 'http://www.abc.net.au/news/feed/6910/rss.xml'), ('Politics', 'https://www.abc.net.au/news/feed/51120/rss.xml'),
('Sydney', 'http://www.abc.net.au/news/feed/10232/rss.xml'), ('World', 'https://www.abc.net.au/news/feed/6497190/rss.xml'),
('Melbourne', 'http://www.abc.net.au/news/feed/21708/rss.xml'), ('Business', 'https://www.abc.net.au/news/feed/51892/rss.xml'),
('Brisbane', 'http://www.abc.net.au/news/feed/12858/rss.xml'), ('Analysis', 'https://www.abc.net.au/news/feed/7571224/rss.xml'),
('Perth', 'feed://www.abc.net.au/news/feed/24886/rss.xml'), ('Sport', 'https://www.abc.net.au/news/feed/2942460/rss.xml'),
('Australia', 'http://www.abc.net.au/news/feed/46182/rss.xml'), ('Adelaide', 'https://www.abc.net.au/news/feed/8057540/rss.xml'),
('World', 'http://www.abc.net.au/news/feed/52278/rss.xml'), ('Brisbane', 'https://www.abc.net.au/news/feed/12858/rss.xml'),
('Business', 'http://www.abc.net.au/news/feed/51892/rss.xml'), ('Canberra', 'https://www.abc.net.au/news/feed/6910/rss.xml'),
('Science and Technology', ('Darwin', 'https://www.abc.net.au/news/feed/8057648/rss.xml'),
'http://www.abc.net.au/news/feed/2298/rss.xml'), ('Hobart', 'https://www.abc.net.au/news/feed/8054562/rss.xml'),
('Melbourne', 'https://www.abc.net.au/news/feed/21708/rss.xml'),
('Sydney', 'https://www.abc.net.au/news/feed/10232/rss.xml'),
('Perth', 'https://www.abc.net.au/news/feed/24886/rss.xml'),
] ]

Binary file not shown.

Before

Width:  |  Height:  |  Size: 332 B

After

Width:  |  Height:  |  Size: 717 B