4
__copyright__ = '2008-2009, Darko Miletic <darko.miletic at gmail.com>'
6
economictimes.indiatimes.com
9
from calibre.web.feeds.news import BasicNewsRecipe
10
from calibre.ebooks.BeautifulSoup import BeautifulSoup, Tag
12
class TheEconomicTimes(BasicNewsRecipe):
13
title = 'The Economic Times India'
14
__author__ = 'Darko Miletic'
15
description = 'Financial news from India'
16
publisher = 'economictimes.indiatimes.com'
17
category = 'news, finances, politics, India'
19
max_articles_per_feed = 100
21
use_embedded_content = False
22
simultaneous_downloads = 1
25
language = _('English')
28
'--comment', description
29
, '--category', category
30
, '--publisher', publisher
34
html2epub_options = 'publisher="' + publisher + '"\ncomments="' + description + '"\ntags="' + category + '"\nlinearize_tables=True'
36
feeds = [(u'All articles', u'http://economictimes.indiatimes.com/rssfeedsdefault.cms')]
38
def print_version(self, url):
39
rest, sep, art = url.rpartition('/articleshow/')
40
return 'http://economictimes.indiatimes.com/articleshow/' + art + '?prtpage=1'
42
def get_article_url(self, article):
43
rurl = article.get('link', None)
44
if (rurl.find('/quickieslist/') > 0) or (rurl.find('/quickiearticleshow/') > 0):
48
def preprocess_html(self, soup):
49
soup.html['xml:lang'] = self.lang
50
soup.html['lang'] = self.lang
51
mlang = Tag(soup,'meta',[("http-equiv","Content-Language"),("content",self.lang)])
52
mcharset = Tag(soup,'meta',[("http-equiv","Content-Type"),("content","text/html; charset=utf-8")])
53
soup.head.insert(0,mlang)
54
soup.head.insert(1,mcharset)
55
return self.adeify_images(soup)
b'\\ No newline at end of file'