diff --git a/recipes/toi.recipe b/recipes/toi.recipe index 7ef5050396..8644126663 100644 --- a/recipes/toi.recipe +++ b/recipes/toi.recipe @@ -9,7 +9,7 @@ from calibre.web.feeds.news import BasicNewsRecipe class TheEconomicTimes(BasicNewsRecipe): title = 'The Times of India' - __author__ = 'Karthik K' + __author__ = 'Karthik' description = 'News from the Indian daily Times of India' publisher = 'timesofindia.indiatimes.com' category = 'news, finances, politics, sports, business, entertainment, India' @@ -24,21 +24,23 @@ class TheEconomicTimes(BasicNewsRecipe): masthead_url = 'http://timesofindia.indiatimes.com/photo.cms?msid=2419189' extra_css = """ body{font-family: Arial,Helvetica,sans-serif} - .foto_mg{font-size: 60%; + .foto_mg{font-size: 60%; font-weight: 700;} h1{font-size: 150%;} artdate{font-size: 60%} artag{font-size: 60%} div.storycontent{padding-top: 10px} """ - conversion_options = {'comment' : description, + conversion_options = {'comment' : description, 'tags' : category, 'publisher' : publisher, 'language' : language } remove_tags_before = dict(name='h1') remove_tags_after = dict(name='div', attrs={'class':'storycontent'}) - remove_attributes = ['xmlns'] + remove_attributes = ['xmlns', 'style'] + remove_tags = [dict(name='div', attrs={'class':'readalso'})] + feeds = [('Recent Stories', 'http://timesofindia.indiatimes.com/rssfeeds/1221656.cms'), ('India', 'http://timesofindia.indiatimes.com/rssfeeds/-2128936835.cms'), ('World', 'http://timesofindia.indiatimes.com/rssfeeds/296589292.cms'), @@ -51,22 +53,15 @@ class TheEconomicTimes(BasicNewsRecipe): ('Opinion', 'http://timesofindia.indiatimes.com/rssfeeds/784865811.cms'), ('Entertainment', 'http://timesofindia.indiatimes.com/rssfeeds/1081479906.cms')] - - #Uses the mobile print version. For web print version use 'http://timesofindia.indiatimes.com/articleshow/?prtpage=1' def print_version(self, url): - rest, sep, article_id = url.rpartition('/articleshow/') - return 'http://m.timesofindia.com/PDAET/articleshow/' + article_id + return url.replace('/articleshow/', '/articleshowprint/') + # For mobile version + # return 'http://m.timesofindia.com/PDAET/articleshow/' + article_id def get_article_url(self, article): rurl = article.get('guid', None) - if (rurl.find('/quickieslist/') > 0) or (rurl.find('/quickiearticleshow/') > 0): - return None - return rurl - - def preprocess_html(self, soup): - for item in soup.findAll(style=True): - del item['style'] - return soup + if '/articleshow/' in rurl: + return rurl def postprocess_html(self, soup, first_fetch): return self.adeify_images(soup)