mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Update Business Standard
This commit is contained in:
parent
42dcabc8dd
commit
76924d0146
@ -7,6 +7,12 @@ www.business-standard.com
|
|||||||
from calibre.web.feeds.recipes import BasicNewsRecipe
|
from calibre.web.feeds.recipes import BasicNewsRecipe
|
||||||
|
|
||||||
|
|
||||||
|
def classes(classes):
|
||||||
|
q = frozenset(classes.split(' '))
|
||||||
|
return dict(attrs={
|
||||||
|
'class': lambda x: x and frozenset(x.split()).intersection(q)})
|
||||||
|
|
||||||
|
|
||||||
class BusinessStandard(BasicNewsRecipe):
|
class BusinessStandard(BasicNewsRecipe):
|
||||||
title = 'Business Standard'
|
title = 'Business Standard'
|
||||||
__author__ = 'Darko Miletic'
|
__author__ = 'Darko Miletic'
|
||||||
@ -15,24 +21,23 @@ class BusinessStandard(BasicNewsRecipe):
|
|||||||
max_articles_per_feed = 100
|
max_articles_per_feed = 100
|
||||||
no_stylesheets = True
|
no_stylesheets = True
|
||||||
use_embedded_content = False
|
use_embedded_content = False
|
||||||
auto_cleanup = False
|
encoding = 'utf-8'
|
||||||
encoding = 'cp1252'
|
|
||||||
publisher = 'Business Standard Limited'
|
publisher = 'Business Standard Limited'
|
||||||
category = 'news, business, money, india, world'
|
category = 'news, business, money, india, world'
|
||||||
language = 'en_IN'
|
language = 'en_IN'
|
||||||
masthead_url = 'http://feeds.business-standard.com/images/logo_08.jpg'
|
|
||||||
|
|
||||||
conversion_options = {
|
conversion_options = {
|
||||||
'comments': description, 'tags': category, 'language': language, 'publisher': publisher, 'linearize_tables': True
|
'comments': description, 'tags': category, 'language': language, 'publisher': publisher, 'linearize_tables': True
|
||||||
}
|
}
|
||||||
remove_tags = [
|
remove_attributes = ['width', 'height', 'style']
|
||||||
dict(name=['object', 'link', 'script', 'iframe', 'base', 'meta']), dict(
|
keep_only_tags = [
|
||||||
attrs={'class': 'rightDiv2'}), dict(name='table', attrs={'width': '450px'})
|
classes('headline alternativeHeadline full-img story-content pubDate'),
|
||||||
|
]
|
||||||
|
remove_tags = [
|
||||||
|
classes('also-read-panel')
|
||||||
]
|
]
|
||||||
remove_attributes = ['width', 'height']
|
|
||||||
|
|
||||||
feeds = [
|
feeds = [
|
||||||
|
|
||||||
(u'News Now', u'http://feeds.business-standard.com/rss/online.xml'),
|
(u'News Now', u'http://feeds.business-standard.com/rss/online.xml'),
|
||||||
(u'Banking & finance', u'http://feeds.business-standard.com/rss/3_0.xml'),
|
(u'Banking & finance', u'http://feeds.business-standard.com/rss/3_0.xml'),
|
||||||
(u'Companies & Industry', u'http://feeds.business-standard.com/rss/2_0.xml'),
|
(u'Companies & Industry', u'http://feeds.business-standard.com/rss/2_0.xml'),
|
||||||
@ -43,8 +48,3 @@ class BusinessStandard(BasicNewsRecipe):
|
|||||||
(u'Management & Mktg', u'http://feeds.business-standard.com/rss/7_0.xml'),
|
(u'Management & Mktg', u'http://feeds.business-standard.com/rss/7_0.xml'),
|
||||||
(u'Opinion', u'http://feeds.business-standard.com/rss/5_0.xml')
|
(u'Opinion', u'http://feeds.business-standard.com/rss/5_0.xml')
|
||||||
]
|
]
|
||||||
|
|
||||||
def print_version(self, url):
|
|
||||||
l, s, tp = url.rpartition('/')
|
|
||||||
t, k, autono = l.rpartition('/')
|
|
||||||
return 'http://www.business-standard.com/india/printpage.php?autono=' + autono + '&tp=' + tp
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user