mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Update The Independent
This commit is contained in:
parent
9fe933c9e8
commit
be37ccfb56
@ -1,13 +1,8 @@
|
||||
# adapted from old recipe by Darko Miletic <darko.miletic at gmail.com>
|
||||
|
||||
import re
|
||||
from calibre.web.feeds.recipes import BasicNewsRecipe
|
||||
|
||||
class TheIndependentNew(BasicNewsRecipe):
|
||||
|
||||
# used for converting rating to stars
|
||||
_STAR_URL = 'http://www.independent.co.uk/skins/ind/images/rating_star.png'
|
||||
_NO_STAR_URL = 'http://www.independent.co.uk/skins/ind/images/rating_star_grey.png'
|
||||
|
||||
title = u'The Independent'
|
||||
__author__ = 'Krittika Goyal'
|
||||
description = 'The latest in UK News and World News from The \
|
||||
@ -23,13 +18,20 @@ class TheIndependentNew(BasicNewsRecipe):
|
||||
no_stylesheets = True
|
||||
use_embedded_content = False
|
||||
remove_empty_feeds = True
|
||||
auto_cleanup = True
|
||||
language = 'en_GB'
|
||||
publication_type = 'newspaper'
|
||||
masthead_url = 'http://www.independent.co.uk/independent.co.uk/editorial/logo/independent_Masthead.png'
|
||||
encoding = 'utf-8'
|
||||
compress_news_images = True
|
||||
|
||||
keep_only_tags = [dict(id='main')]
|
||||
remove_tags = [
|
||||
dict(attrs={'class':['column-2', 'article-links', 'second-gallery', 'buttons']}),
|
||||
dict(attrs={'class':lambda x: x and 'share-tool-ctr' in x.split()}),
|
||||
dict(id=lambda x: x and re.match(r'slideshow-\d+', x)),
|
||||
dict(id=['anchor-href-comment', 'anchor-href-reply', 'commentReference']),
|
||||
]
|
||||
|
||||
feeds = [
|
||||
(u'News - UK',
|
||||
u'http://www.independent.co.uk/news/uk/?service=rss'),
|
||||
@ -139,5 +141,3 @@ class TheIndependentNew(BasicNewsRecipe):
|
||||
(u'IndyBest',
|
||||
u'http://www.independent.co.uk/extras/indybest/?service=rss'),
|
||||
]
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user