diff --git a/src/calibre/gui2/images/news/theeconomictimes_india.png b/src/calibre/gui2/images/news/theeconomictimes_india.png new file mode 100644 index 0000000000..ddd252d6b6 Binary files /dev/null and b/src/calibre/gui2/images/news/theeconomictimes_india.png differ diff --git a/src/calibre/web/feeds/recipes/__init__.py b/src/calibre/web/feeds/recipes/__init__.py index 57cd30874b..d7e9a8930e 100644 --- a/src/calibre/web/feeds/recipes/__init__.py +++ b/src/calibre/web/feeds/recipes/__init__.py @@ -48,6 +48,7 @@ recipe_modules = ['recipe_' + r for r in ( 'the_budget_fashionista', 'elperiodico_catalan', 'elperiodico_spanish', 'expansion_spanish', 'lavanguardia', 'marca', 'kellog_faculty', 'kellog_insight', + 'theeconomictimes_india', )] import re, imp, inspect, time, os diff --git a/src/calibre/web/feeds/recipes/recipe_theeconomictimes_india.py b/src/calibre/web/feeds/recipes/recipe_theeconomictimes_india.py new file mode 100644 index 0000000000..b621ae55c0 --- /dev/null +++ b/src/calibre/web/feeds/recipes/recipe_theeconomictimes_india.py @@ -0,0 +1,56 @@ +#!/usr/bin/env python + +__license__ = 'GPL v3' +__copyright__ = '2008-2009, Darko Miletic ' +''' +economictimes.indiatimes.com +''' + +from calibre.web.feeds.news import BasicNewsRecipe +from calibre.ebooks.BeautifulSoup import BeautifulSoup, Tag + +class TheEconomicTimes(BasicNewsRecipe): + title = 'The Economic Times India' + __author__ = 'Darko Miletic' + description = 'Financial news from India' + publisher = 'economictimes.indiatimes.com' + category = 'news, finances, politics, India' + oldest_article = 2 + max_articles_per_feed = 100 + no_stylesheets = True + use_embedded_content = False + simultaneous_downloads = 1 + encoding = 'utf-8' + lang = 'en-IN' + language = _('English') + + html2lrf_options = [ + '--comment', description + , '--category', category + , '--publisher', publisher + , '--ignore-tables' + ] + + html2epub_options = 'publisher="' + publisher + '"\ncomments="' + description + '"\ntags="' + category + '"\nlinearize_tables=True' + + feeds = [(u'All articles', u'http://economictimes.indiatimes.com/rssfeedsdefault.cms')] + + def print_version(self, url): + rest, sep, art = url.rpartition('/articleshow/') + return 'http://economictimes.indiatimes.com/articleshow/' + art + '?prtpage=1' + + def get_article_url(self, article): + rurl = article.get('link', None) + if (rurl.find('/quickieslist/') > 0) or (rurl.find('/quickiearticleshow/') > 0): + return None + return rurl + + def preprocess_html(self, soup): + soup.html['xml:lang'] = self.lang + soup.html['lang'] = self.lang + mlang = Tag(soup,'meta',[("http-equiv","Content-Language"),("content",self.lang)]) + mcharset = Tag(soup,'meta',[("http-equiv","Content-Type"),("content","text/html; charset=utf-8")]) + soup.head.insert(0,mlang) + soup.head.insert(1,mcharset) + return self.adeify_images(soup) + \ No newline at end of file