mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
New recipe for Livemint by Darko Miletic
This commit is contained in:
parent
5f87805c63
commit
3e5a21ef42
BIN
src/calibre/gui2/images/news/livemint.png
Normal file
BIN
src/calibre/gui2/images/news/livemint.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 853 B |
@ -55,7 +55,7 @@ recipe_modules = ['recipe_' + r for r in (
|
|||||||
'eltiempo_hn', 'slate', 'tnxm', 'bbcvietnamese', 'vnexpress',
|
'eltiempo_hn', 'slate', 'tnxm', 'bbcvietnamese', 'vnexpress',
|
||||||
'volksrant', 'theeconomictimes_india', 'ourdailybread',
|
'volksrant', 'theeconomictimes_india', 'ourdailybread',
|
||||||
'monitor', 'republika', 'beta', 'beta_en', 'glasjavnosti',
|
'monitor', 'republika', 'beta', 'beta_en', 'glasjavnosti',
|
||||||
'esquire',
|
'esquire', 'livemint',
|
||||||
)]
|
)]
|
||||||
|
|
||||||
|
|
||||||
|
43
src/calibre/web/feeds/recipes/recipe_livemint.py
Normal file
43
src/calibre/web/feeds/recipes/recipe_livemint.py
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
#!/usr/bin/env python
|
||||||
|
|
||||||
|
__license__ = 'GPL v3'
|
||||||
|
__copyright__ = '2009, Darko Miletic <darko.miletic at gmail.com>'
|
||||||
|
'''
|
||||||
|
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)
|
Loading…
x
Reference in New Issue
Block a user