mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Update Telegraph UK
This commit is contained in:
parent
a0fb42865d
commit
727944a4b5
@ -12,7 +12,8 @@ class TelegraphUK(BasicNewsRecipe):
|
|||||||
description = 'News from United Kingdom'
|
description = 'News from United Kingdom'
|
||||||
oldest_article = 2
|
oldest_article = 2
|
||||||
category = 'news, politics, UK'
|
category = 'news, politics, UK'
|
||||||
publisher = 'Telegraph Media Group ltd.'
|
publisher = 'Telegraph Media Group ltd.'
|
||||||
|
compress_news_images = True
|
||||||
max_articles_per_feed = 100
|
max_articles_per_feed = 100
|
||||||
no_stylesheets = True
|
no_stylesheets = True
|
||||||
language = 'en_GB'
|
language = 'en_GB'
|
||||||
@ -34,30 +35,30 @@ class TelegraphUK(BasicNewsRecipe):
|
|||||||
, 'publisher' : publisher
|
, 'publisher' : publisher
|
||||||
, 'language' : language
|
, 'language' : language
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
keep_only_tags = [
|
keep_only_tags = [
|
||||||
dict(name='div', attrs={'class':['storyHead','byline']})
|
dict(name='div', attrs={'class':['storyHead','byline']})
|
||||||
,dict(name='div', attrs={'id':'mainBodyArea' })
|
,dict(name='div', attrs={'id':'mainBodyArea'})
|
||||||
]
|
]
|
||||||
remove_tags = [dict(name='div', attrs={'class':['related_links_inline',"imgindex","next","prev","gutterUnder",'ssImgHide','imageExtras','ssImg hide','related_links_video']})
|
remove_tags = [dict(name='div', attrs={
|
||||||
|
'class':['related_links_inline',"imgindex","next","prev","gutterUnder",'ssImgHide','imageExtras','ssImg hide','related_links_video']})
|
||||||
,dict(name='ul' , attrs={'class':['shareThis shareBottom']})
|
,dict(name='ul' , attrs={'class':['shareThis shareBottom']})
|
||||||
,dict(name='span', attrs={'class':['num','placeComment']})
|
,dict(name='span', attrs={'class':['num','placeComment']})
|
||||||
]
|
]
|
||||||
|
|
||||||
feeds = [
|
feeds = [
|
||||||
(u'UK News' , u'http://www.telegraph.co.uk/news/uknews/rss' )
|
(u'UK News' , u'http://www.telegraph.co.uk/news/uknews/rss')
|
||||||
,(u'World News' , u'http://www.telegraph.co.uk/news/worldnews/rss' )
|
,(u'World News' , u'http://www.telegraph.co.uk/news/worldnews/rss')
|
||||||
,(u'Politics' , u'http://www.telegraph.co.uk/news/newstopics/politics/rss' )
|
,(u'Politics' , u'http://www.telegraph.co.uk/news/newstopics/politics/rss')
|
||||||
,(u'Finance' , u'http://www.telegraph.co.uk/finance/rss' )
|
,(u'Finance' , u'http://www.telegraph.co.uk/finance/rss')
|
||||||
,(u'Technology News', u'http://www.telegraph.co.uk/scienceandtechnology/technology/technologynews/rss' )
|
,(u'Technology News', u'http://www.telegraph.co.uk/scienceandtechnology/technology/technologynews/rss')
|
||||||
,(u'UK News' , u'http://www.telegraph.co.uk/scienceandtechnology/technology/technologyreviews/rss')
|
,(u'UK News' , u'http://www.telegraph.co.uk/scienceandtechnology/technology/technologyreviews/rss')
|
||||||
,(u'Science News' , u'http://www.telegraph.co.uk/scienceandtechnology/science/sciencenews/rss' )
|
,(u'Science News' , u'http://www.telegraph.co.uk/scienceandtechnology/science/sciencenews/rss')
|
||||||
,(u'Sport' , u'http://www.telegraph.co.uk/sport/rss' )
|
,(u'Sport' , u'http://www.telegraph.co.uk/sport/rss')
|
||||||
,(u'Earth News' , u'http://www.telegraph.co.uk/earth/earthnews/rss' )
|
,(u'Earth News' , u'http://www.telegraph.co.uk/earth/earthnews/rss')
|
||||||
,(u'Comment' , u'http://www.telegraph.co.uk/comment/rss' )
|
,(u'Comment' , u'http://www.telegraph.co.uk/comment/rss')
|
||||||
,(u'Travel' , u'http://www.telegraph.co.uk/travel/rss' )
|
,(u'Travel' , u'http://www.telegraph.co.uk/travel/rss')
|
||||||
,(u'How about that?', u'http://www.telegraph.co.uk/news/newstopics/howaboutthat/rss' )
|
,(u'How about that?', u'http://www.telegraph.co.uk/news/newstopics/howaboutthat/rss')
|
||||||
]
|
]
|
||||||
def populate_article_metadata(self, article, soup, first):
|
def populate_article_metadata(self, article, soup, first):
|
||||||
if first and hasattr(self, 'add_toc_thumbnail'):
|
if first and hasattr(self, 'add_toc_thumbnail'):
|
||||||
@ -70,3 +71,4 @@ class TelegraphUK(BasicNewsRecipe):
|
|||||||
if 'picture-galleries' in url or 'pictures' in url or 'picturegalleries' in url :
|
if 'picture-galleries' in url or 'pictures' in url or 'picturegalleries' in url :
|
||||||
url = None
|
url = None
|
||||||
return url
|
return url
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user