This commit is contained in:
Kovid Goyal 2020-02-24 07:14:00 +05:30
parent 4664ef6f38
commit 1088d699b7
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 8 additions and 6 deletions

View File

@ -6,6 +6,7 @@ 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, James Cridland' __author__ = 'Pat Stapleton, Dean Cording, James Cridland'
@ -25,7 +26,7 @@ class ABCNews(BasicNewsRecipe):
publication_type = 'newspaper' publication_type = 'newspaper'
extra_css = '.byline{font-size:smaller;margin-bottom:10px;}.inline-caption{display:block;font-size:smaller;text-decoration: none;}' extra_css = '.byline{font-size:smaller;margin-bottom:10px;}.inline-caption{display:block;font-size:smaller;text-decoration: none;}'
preprocess_regexps = [(re.compile( preprocess_regexps = [(re.compile(
r'<a class="inline-caption" href="http://maps\.google\.com.*?/a>', re.DOTALL), lambda m: '')] # Remove map links 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
} }
@ -36,9 +37,9 @@ class ABCNews(BasicNewsRecipe):
'inline-content story left', 'inline-content map left contracted', 'inline-content story left', 'inline-content map left contracted',
'inline-content full embedYouTube embedded', 'published', 'inline-content full embedYouTube embedded', 'published',
'story-map', 'statepromo', 'topics', ]})] 'story-map', 'statepromo', 'topics', ]})]
#inner = key points # inner = key points
#attached-content = related stories # attached-content = related stories
#authorpromo = "Contact NameOfJournalist" # authorpromo = "Contact NameOfJournalist"
remove_attributes = ['width', 'height'] remove_attributes = ['width', 'height']
@ -57,4 +58,4 @@ class ABCNews(BasicNewsRecipe):
('Melbourne', 'https://www.abc.net.au/news/feed/21708/rss.xml'), ('Melbourne', 'https://www.abc.net.au/news/feed/21708/rss.xml'),
('Sydney', 'https://www.abc.net.au/news/feed/10232/rss.xml'), ('Sydney', 'https://www.abc.net.au/news/feed/10232/rss.xml'),
('Perth', 'https://www.abc.net.au/news/feed/24886/rss.xml'), ('Perth', 'https://www.abc.net.au/news/feed/24886/rss.xml'),
] ]

View File

@ -1,6 +1,7 @@
from calibre.web.feeds.news import BasicNewsRecipe from calibre.web.feeds.news import BasicNewsRecipe
import datetime import datetime
class Politics(BasicNewsRecipe): class Politics(BasicNewsRecipe):
title = u'The Courier-Mail' title = u'The Courier-Mail'
description = 'Breaking news headlines for Brisbane and Queensland, Australia. The Courier-Mail is owned by News Corp Australia.' description = 'Breaking news headlines for Brisbane and Queensland, Australia. The Courier-Mail is owned by News Corp Australia.'
@ -28,4 +29,4 @@ class Politics(BasicNewsRecipe):
('Sport', 'https://www.couriermail.com.au/sport/rss'), ('Sport', 'https://www.couriermail.com.au/sport/rss'),
] ]
# This isn't perfect, but works rather better than it once did. To do - remove links to subscription content. # This isn't perfect, but works rather better than it once did. To do - remove links to subscription content.