mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-11-13 18:16:59 -05:00
41 lines
1.2 KiB
Plaintext
41 lines
1.2 KiB
Plaintext
__license__ = 'GPL v3'
|
|
__copyright__ = '2009 Neil Grogan'
|
|
#
|
|
# Irish Independent Recipe
|
|
#
|
|
|
|
from calibre.web.feeds.news import BasicNewsRecipe, classes
|
|
|
|
|
|
class IrishIndependent(BasicNewsRecipe):
|
|
title = u'Irish Independent'
|
|
description = 'Irish and World news from Irelands Bestselling Daily Broadsheet'
|
|
__author__ = 'Neil Grogan'
|
|
language = 'en_IE'
|
|
oldest_article = 2
|
|
max_articles_per_feed = 100
|
|
no_stylesheets = True
|
|
|
|
keep_only_tags = [
|
|
dict(name='div', attrs={'class':lambda x: x and '_contentwrapper' in x})
|
|
]
|
|
|
|
remove_tags = [
|
|
dict(name='div', attrs={'data-testid':['article-share', 'embed-video']})
|
|
]
|
|
|
|
feeds = [
|
|
('News', 'http://www.independent.ie/rss'),
|
|
('Opinion', 'http://www.independent.ie/opinion/rss'),
|
|
('Business', 'http://www.independent.ie/business/rss'),
|
|
('Sport', 'http://www.independent.ie/sport/rss'),
|
|
('Life', 'http://www.independent.ie/life/rss'),
|
|
('Style', 'http://www.independent.ie/style/rss'),
|
|
('Entertainment', 'http://www.independent.ie/business/rss'),
|
|
]
|
|
|
|
def preprocess_html(self, soup):
|
|
for img in soup.findAll(attrs={'data-src': True}):
|
|
img['src'] = img['data-src']
|
|
return soup
|