mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Improved recipe for The Hindu
This commit is contained in:
parent
bddbefd121
commit
6914dd8b20
@ -10,17 +10,21 @@ class TheHindu(BasicNewsRecipe):
|
|||||||
language = 'en_IN'
|
language = 'en_IN'
|
||||||
|
|
||||||
oldest_article = 7
|
oldest_article = 7
|
||||||
__author__ = _('Kovid Goyal')
|
__author__ = 'Kovid Goyal and Sujata Raman'
|
||||||
max_articles_per_feed = 100
|
max_articles_per_feed = 100
|
||||||
|
no_stylesheets = True
|
||||||
|
|
||||||
remove_tags_before = {'name':'font', 'class':'storyhead'}
|
remove_tags_before = {'name':'font', 'class':'storyhead'}
|
||||||
preprocess_regexps = [
|
preprocess_regexps = [
|
||||||
(re.compile(r'<!-- story ends -->.*', re.DOTALL),
|
(re.compile(r'<!-- story ends -->.*', re.DOTALL),
|
||||||
lambda match: '</body></html>'),
|
lambda match: '</body></html>'),
|
||||||
]
|
]
|
||||||
|
extra_css = '''
|
||||||
|
.storyhead{font-family:Arial,Helvetica,sans-serif; font-size:large; color:#000099;}
|
||||||
|
body{font-family:Verdana,Arial,Helvetica,sans-serif; font-size:x-small; text-align:left;}
|
||||||
|
'''
|
||||||
feeds = [
|
feeds = [
|
||||||
(u'Main - Font Page', u'http://www.hindu.com/rss/01hdline.xml'),
|
(u'Main - Front Page', u'http://www.hindu.com/rss/01hdline.xml'),
|
||||||
(u'Main - National', u'http://www.hindu.com/rss/02hdline.xml'),
|
(u'Main - National', u'http://www.hindu.com/rss/02hdline.xml'),
|
||||||
(u'Main - International', u'http://www.hindu.com/rss/03hdline.xml'),
|
(u'Main - International', u'http://www.hindu.com/rss/03hdline.xml'),
|
||||||
(u'Main - Opinion', u'http://www.hindu.com/rss/05hdline.xml'),
|
(u'Main - Opinion', u'http://www.hindu.com/rss/05hdline.xml'),
|
||||||
@ -43,6 +47,8 @@ class TheHindu(BasicNewsRecipe):
|
|||||||
]
|
]
|
||||||
|
|
||||||
def postprocess_html(self, soup, first_fetch):
|
def postprocess_html(self, soup, first_fetch):
|
||||||
for t in soup.findAll(['table', 'tr', 'td']):
|
for t in soup.findAll(['table', 'tr', 'td','center']):
|
||||||
t.name = 'div'
|
t.name = 'div'
|
||||||
|
|
||||||
|
|
||||||
return soup
|
return soup
|
||||||
|
Loading…
x
Reference in New Issue
Block a user