mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Updated recipe for Telegraph UK
This commit is contained in:
parent
1698282f2c
commit
264d032646
@ -1,38 +1,58 @@
|
|||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
|
__license__ = 'GPL v3'
|
||||||
__license__ = 'GPL v3'
|
__copyright__ = '2008, Darko Miletic <darko.miletic at gmail.com>'
|
||||||
__copyright__ = '2008, Darko Miletic <darko.miletic at gmail.com>'
|
'''
|
||||||
'''
|
telegraph.co.uk
|
||||||
telegraph.co.uk
|
'''
|
||||||
'''
|
|
||||||
|
from calibre.web.feeds.news import BasicNewsRecipe
|
||||||
from calibre.web.feeds.news import BasicNewsRecipe
|
|
||||||
|
class TelegraphUK(BasicNewsRecipe):
|
||||||
class TelegraphUK(BasicNewsRecipe):
|
title = u'Telegraph.co.uk'
|
||||||
title = u'Telegraph.co.uk'
|
__author__ = 'Darko Miletic and Sujata Raman'
|
||||||
__author__ = 'Darko Miletic'
|
description = 'News from United Kingdom'
|
||||||
description = 'News from United Kingdom'
|
oldest_article = 7
|
||||||
oldest_article = 7
|
max_articles_per_feed = 100
|
||||||
max_articles_per_feed = 100
|
no_stylesheets = True
|
||||||
no_stylesheets = True
|
language = _('English')
|
||||||
language = _('English')
|
use_embedded_content = False
|
||||||
use_embedded_content = False
|
|
||||||
|
extra_css = '''
|
||||||
keep_only_tags = [
|
h1{font-family :Arial,Helvetica,sans-serif; font-size:large; color:#666666}
|
||||||
dict(name='div', attrs={'class':'storyHead'})
|
h2{font-family :Arial,Helvetica,sans-serif; font-size:small; color:#444444}
|
||||||
,dict(name='div', attrs={'class':'story' })
|
.story{font-family :Arial,Helvetica,sans-serif; font-size: x-small; color:#444444 }
|
||||||
]
|
.byline{color:#666666; font-family :Arial,Helvetica,sans-serif; font-size: xx-small;}
|
||||||
remove_tags = [dict(name='div', attrs={'class':'slideshow'})]
|
a{color:#234B7B; }
|
||||||
|
.imageExtras{color:#666666; font-family :Arial,Helvetica,sans-serif; font-size: xx-small;}
|
||||||
feeds = [
|
'''
|
||||||
(u'UK News' , u'http://www.telegraph.co.uk/news/uknews/rss' )
|
|
||||||
,(u'World News' , u'http://www.telegraph.co.uk/news/worldnews/rss' )
|
keep_only_tags = [
|
||||||
,(u'Politics' , u'http://www.telegraph.co.uk/news/newstopics/politics/rss' )
|
dict(name='div', attrs={'class':'storyHead'})
|
||||||
,(u'Technology News', u'http://www.telegraph.co.uk/scienceandtechnology/technology/technologynews/rss' )
|
,dict(name='div', attrs={'class':'story' })
|
||||||
,(u'UK News' , u'http://www.telegraph.co.uk/scienceandtechnology/technology/technologyreviews/rss')
|
#,dict(name='div', attrs={'class':['slideshowHD gutterUnder',"twoThirds gutter","caption" ] })
|
||||||
,(u'Science News' , u'http://www.telegraph.co.uk/scienceandtechnology/science/sciencenews/rss' )
|
]
|
||||||
,(u'Sport' , u'http://www.telegraph.co.uk/sport/rss' )
|
remove_tags = [dict(name='div', attrs={'class':['related_links_inline',"imgindex","next","prev","gutterUnder"]})]
|
||||||
,(u'Earth News' , u'http://www.telegraph.co.uk/earth/earthnews/rss' )
|
|
||||||
,(u'Comment' , u'http://www.telegraph.co.uk/comment/rss' )
|
feeds = [
|
||||||
,(u'How about that?', u'http://www.telegraph.co.uk/news/newstopics/howaboutthat/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'Politics' , u'http://www.telegraph.co.uk/news/newstopics/politics/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'Science News' , u'http://www.telegraph.co.uk/scienceandtechnology/science/sciencenews/rss' )
|
||||||
|
,(u'Sport' , u'http://www.telegraph.co.uk/sport/rss' )
|
||||||
|
,(u'Earth News' , u'http://www.telegraph.co.uk/earth/earthnews/rss' )
|
||||||
|
,(u'Comment' , u'http://www.telegraph.co.uk/comment/rss' )
|
||||||
|
,(u'How about that?', u'http://www.telegraph.co.uk/news/newstopics/howaboutthat/rss' )
|
||||||
|
]
|
||||||
|
|
||||||
|
def get_article_url(self, article):
|
||||||
|
|
||||||
|
url = article.get('guid', None)
|
||||||
|
|
||||||
|
if 'picture-galleries' in url or 'pictures' in url or 'picturegalleries' in url :
|
||||||
|
url = None
|
||||||
|
|
||||||
|
return url
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user