mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Improve daily telegraph
This commit is contained in:
parent
d82ad7af94
commit
79396b00f4
@ -6,43 +6,66 @@ __docformat__ = 'restructuredtext en'
|
||||
'''
|
||||
http://www.news.com.au/dailytelegraph/
|
||||
'''
|
||||
import re
|
||||
from calibre.web.feeds.news import BasicNewsRecipe
|
||||
|
||||
class DailyTelegraph(BasicNewsRecipe):
|
||||
title = u'Daily Telegraph'
|
||||
__author__ = u'AprilHare'
|
||||
__author__ = u'Adrian G.'
|
||||
language = 'en_AU'
|
||||
|
||||
description = u'News from down under'
|
||||
oldest_article = 2
|
||||
max_articles_per_feed = 10
|
||||
remove_tags_before = dict(name='div', attrs={'class':'article-title'})
|
||||
remove_tags = [dict(attrs={'class':['article-source', 'article-tools']})]
|
||||
remove_tags_after = dict(attrs={'class':re.compile('share-article')})
|
||||
|
||||
description = u'Daily Telegraph News'
|
||||
oldest_article = 5
|
||||
max_articles_per_feed = 100
|
||||
no_stylesheets = True
|
||||
use_embedded_content = False
|
||||
no_javascript = True
|
||||
|
||||
|
||||
timefmt = ' [%A, %d %B, %Y]'
|
||||
encoding = 'utf-8'
|
||||
|
||||
keep_only_tags = [dict(name='div', attrs ={'id':'story'})]
|
||||
|
||||
extra_css = '''
|
||||
h1{font-family:Georgia,"Times New Roman",Times,serif; font-weight:bold; font-size:large;}
|
||||
.cT-storyDetails{font-family:Arial,Helvetica,sans-serif; color:#666666;font-size:x-small;}
|
||||
.articleBody{font-family:Arial,Helvetica,sans-serif; color:black;font-size:small;}
|
||||
.cT-imageLandscape{font-family:Arial,Helvetica,sans-serif; color:#333333 ;font-size:x-small;}
|
||||
.source{font-family:Arial,Helvetica,sans-serif; color:#333333 ;font-size:xx-small;}
|
||||
#content{font-family:Arial,Helvetica,sans-serif;font-size:x-small;}
|
||||
.pageprint{font-family:Arial,Helvetica,sans-serif;font-size:small;}
|
||||
#bylineDetails{font-family:Arial,Helvetica,sans-serif; color:#666666;font-size:x-small;}
|
||||
.featurePic-wide{font-family:Arial,Helvetica,sans-serif;font-size:x-small;}
|
||||
#idfeaturepic{font-family:Arial,Helvetica,sans-serif;font-size:x-small;}
|
||||
h3{font-family:Georgia,"Times New Roman",Times,serif; font-size:small;}
|
||||
h2{font-family:Georgia,"Times New Roman",Times,serif; font-size:small;}
|
||||
h4{font-family:Georgia,"Times New Roman",Times,serif; font-size:small;}
|
||||
h5{font-family:Georgia,"Times New Roman",Times,serif; font-size:small;}
|
||||
body{font-family:Arial,Helvetica,sans-serif; font-size:x-small;}
|
||||
'''
|
||||
|
||||
remove_tags = [
|
||||
dict(name='div', attrs ={'id':['comments','story-related-coverage']}),
|
||||
dict(name='div', attrs ={'class':['story-header-tools','story-footer','story-extras','story-related']}),
|
||||
dict(name='div', attrs ={'class':['promo-image','story-extras story-extras-2']}),
|
||||
dict(name='div', attrs ={'class':['assistive sidebar-jump']})
|
||||
]
|
||||
|
||||
feeds = [
|
||||
(u'Top Stories', u'http://feeds.news.com.au/public/rss/2.0/dtele_top_stories_253.xml'),
|
||||
(u'National News', u'http://feeds.news.com.au/public/rss/2.0/dtele_national_news_202.xml'),
|
||||
(u'World News', u'http://feeds.news.com.au/public/rss/2.0/dtele_world_news_204.xml'),
|
||||
(u'NSW and ACT', u'http://feeds.news.com.au/public/rss/2.0/dtele_nswact_225.xml'),
|
||||
(u'Arts', u'http://feeds.news.com.au/public/rss/2.0/dtele_art_444.xml'),
|
||||
(u'Business News', u'http://feeds.news.com.au/public/rss/2.0/dtele_business_226.xml'),
|
||||
(u'Entertainment News', u'http://feeds.news.com.au/public/rss/2.0/dtele_entertainment_news_201.xml'),
|
||||
(u'Lifestyle News', u'http://feeds.news.com.au/public/rss/2.0/dtele_lifestyle_227.xml'),
|
||||
(u'Music', u'http://feeds.news.com.au/public/rss/2.0/dtele_music_441.xml'),
|
||||
(u'Property Confidential', u'http://feeds.news.com.au/public/rss/2.0/dtele_property_confidential_463.xml'),
|
||||
(u'Property - Your Space', u'http://feeds.news.com.au/public/rss/2.0/dtele_property_yourspace_462.xml'),
|
||||
(u'Confidential News', u'http://feeds.news.com.au/public/rss/2.0/dtele_entertainment_confidential_252.xml'),
|
||||
(u'Confidential Biographies', u'http://feeds.news.com.au/public/rss/2.0/dtele_confidential_biographies_491.xml'),
|
||||
(u'Confidential Galleries', u'http://feeds.news.com.au/public/rss/2.0/dtele_confidential_galleries_483.xml'),
|
||||
(u'Confidential In-depth', u'http://feeds.news.com.au/public/rss/2.0/dtele_confidential_indepth_490.xml'),
|
||||
(u'Confidential ShowBuzz', u'http://feeds.news.com.au/public/rss/2.0/dtele_confidential_showbuzz_485.xml'),
|
||||
(u'Sport', u'http://feeds.news.com.au/public/rss/2.0/dtele_sport_203.xml'),
|
||||
(u'AFL', u'http://feeds.news.com.au/public/rss/2.0/dtele_sports_afl_341.xml'),
|
||||
(u'Cricket', u'http://feeds.news.com.au/public/rss/2.0/dtele_sports_cricket_343.xml'),
|
||||
(u'Horse Racing', u'http://feeds.news.com.au/public/rss/2.0/dtele_sports_horseracing_686.xml'),
|
||||
(u'NRL', u'http://feeds.news.com.au/public/rss/2.0/dtele_sports_nrl_345.xml'),
|
||||
(u'Rugby Union', u'http://feeds.news.com.au/public/rss/2.0/dtele_sports_rugby_union_342.xml'),
|
||||
(u'Soccer', u'http://feeds.news.com.au/public/rss/2.0/dtele_sports_soccer_344.xml')
|
||||
(u'Top Stories', u'http://feeds.news.com.au/public/rss/2.0/dtele_top_stories_253.xml'),
|
||||
(u'National News', u'http://feeds.news.com.au/public/rss/2.0/dtele_national_news_202.xml'),
|
||||
(u'World News', u'http://feeds.news.com.au/public/rss/2.0/dtele_world_news_204.xml'),
|
||||
(u'NSW and ACT', u'http://feeds.news.com.au/public/rss/2.0/dtele_nswact_225.xml'),
|
||||
(u'Arts', u'http://feeds.news.com.au/public/rss/2.0/dtele_art_444.xml'),
|
||||
(u'Business News', u'http://feeds.news.com.au/public/rss/2.0/dtele_business_226.xml'),
|
||||
(u'Entertainment News', u'http://feeds.news.com.au/public/rss/2.0/dtele_entertainment_news_201.xml'),
|
||||
(u'Lifestyle News', u'http://feeds.news.com.au/public/rss/2.0/dtele_lifestyle_227.xml'),
|
||||
(u'Music', u'http://feeds.news.com.au/public/rss/2.0/dtele_music_441.xml'),
|
||||
(u'Property Confidential', u'http://feeds.news.com.au/public/rss/2.0/dtele_property_confidential_463.xml'),
|
||||
(u'Property - Your Space', u'http://feeds.news.com.au/public/rss/2.0/dtele_property_yourspace_462.xml'),
|
||||
(u'Confidential News', u'http://feeds.news.com.au/public/rss/2.0/dtele_entertainment_confidential_252.xml'),
|
||||
(u'Confidential Biographies', u'http://feeds.news.com.au/public/rss/2.0/dtele_confidential_biographies_491.xml'),
|
||||
(u'Confidential Galleries', u'http://feeds.news.com.au/public/rss/2.0/dtele_confidential_galleries_483.xml'),
|
||||
]
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user