diff --git a/src/calibre/gui2/images/news/livemint.png b/src/calibre/gui2/images/news/livemint.png new file mode 100644 index 0000000000..5fb3cf7e89 Binary files /dev/null and b/src/calibre/gui2/images/news/livemint.png differ diff --git a/src/calibre/web/feeds/recipes/__init__.py b/src/calibre/web/feeds/recipes/__init__.py index a214ca7fa6..7f9723063c 100644 --- a/src/calibre/web/feeds/recipes/__init__.py +++ b/src/calibre/web/feeds/recipes/__init__.py @@ -55,7 +55,7 @@ recipe_modules = ['recipe_' + r for r in ( 'eltiempo_hn', 'slate', 'tnxm', 'bbcvietnamese', 'vnexpress', 'volksrant', 'theeconomictimes_india', 'ourdailybread', 'monitor', 'republika', 'beta', 'beta_en', 'glasjavnosti', - 'esquire', + 'esquire', 'livemint', )] diff --git a/src/calibre/web/feeds/recipes/recipe_livemint.py b/src/calibre/web/feeds/recipes/recipe_livemint.py new file mode 100644 index 0000000000..5813233b86 --- /dev/null +++ b/src/calibre/web/feeds/recipes/recipe_livemint.py @@ -0,0 +1,43 @@ +#!/usr/bin/env python + +__license__ = 'GPL v3' +__copyright__ = '2009, Darko Miletic ' +''' +www.livemint.com +''' + +from calibre.web.feeds.news import BasicNewsRecipe + +class LiveMint(BasicNewsRecipe): + title = u'Livemint' + __author__ = 'Darko Miletic' + description = 'The Wall Street Journal' + publisher = 'The Wall Street Journal' + category = 'news, games, adventure, technology' + language = _('English') + oldest_article = 15 + max_articles_per_feed = 100 + no_stylesheets = True + encoding = 'utf-8' + use_embedded_content = False + extra_css = ' #dvArtheadline{font-size: x-large} #dvArtAbstract{font-size: large} ' + + keep_only_tags = [dict(name='div', attrs={'class':'innercontent'})] + + remove_tags = [dict(name=['object','link','embed','form','iframe'])] + + feeds = [(u'Articles', u'http://www.livemint.com/SectionRssfeed.aspx?Mid=1')] + + def print_version(self, url): + link = url + try: + msoup = self.index_to_soup(link) + except: + return 'http://invalid_url_generated_by_calibre.com' + mlink = msoup.find(attrs={'id':'ctl00_bodyplaceholdercontent_cntlArtTool_printUrl'}) + if mlink: + link = 'http://www.livemint.com/Articles/' + mlink['href'].rpartition('/Articles/')[2] + return link + + def preprocess_html(self, soup): + return self.adeify_images(soup)