calibre/recipes/businessworldin.recipe
Kovid Goyal 383e16cff2 Update Business World Magazine
Fixes #1534463 [Business World Indian Recipe not working](https://bugs.launchpad.net/calibre/+bug/1534463)
2016-01-20 14:59:39 +05:30

36 lines
1.1 KiB
Plaintext

__license__ = 'GPL v3'
__copyright__ = '2009-2010, Darko Miletic <darko.miletic at gmail.com>'
'''
www.businessworld.in
'''
from calibre.web.feeds.news import BasicNewsRecipe
class BusinessWorldMagazine(BasicNewsRecipe):
title = 'Business World Magazine'
__author__ = 'Kovid Goyal'
description = 'News from India'
category = 'news, politics, finances, India, Asia'
no_stylesheets = True
encoding = 'utf-8'
language = 'en_IN'
oldest_article = 2
keep_only_tags = [
dict(attrs={'class':['main-article']}),
]
remove_tags = [
dict(id='video_n_ad_div'),
dict(attrs={'class':['meta-tools', 'social-article']}),
]
remove_tags_after = dict(attrs={'class':'social-article'})
feeds = ['http://www.businessworld.in/rss/all-article.xml']
def preprocess_html(self, soup):
for img in soup.findAll('img', attrs={'data-original':True}):
img['src'] = img['data-original']
for ins in soup.findAll(attrs={'class':'adsbygoogle'}):
ins.parent.extract()
return soup