mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
New recipe for The Intelligencer by Darko Miletic
This commit is contained in:
parent
6b4be93c10
commit
b34bdd60cd
@ -48,6 +48,8 @@ def freeze():
|
||||
'/usr/lib/libdbus-1.so.3',
|
||||
'/usr/lib/libopenjpeg.so.2',
|
||||
'/usr/lib/libxslt.so.1',
|
||||
'/usr/lib64/libjpeg.so.7'.replace('64', '64' if is64bit
|
||||
else ''),
|
||||
'/usr/lib/libxslt.so.1',
|
||||
'/usr/lib/libgthread-2.0.so.0',
|
||||
'/usr/lib/gcc/***-pc-linux-gnu/4.4.1/libstdc++.so.6'.replace('***',
|
||||
|
@ -56,6 +56,7 @@ recipe_modules = ['recipe_' + r for r in (
|
||||
'volksrant', 'theeconomictimes_india', 'ourdailybread',
|
||||
'monitor', 'republika', 'beta', 'beta_en', 'glasjavnosti',
|
||||
'esquire', 'livemint', 'thedgesingapore', 'darknet', 'rga',
|
||||
'intelligencer',
|
||||
)]
|
||||
|
||||
|
||||
|
45
src/calibre/web/feeds/recipes/recipe_intelligencer.py
Normal file
45
src/calibre/web/feeds/recipes/recipe_intelligencer.py
Normal file
@ -0,0 +1,45 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
__license__ = 'GPL v3'
|
||||
__copyright__ = '2009, Darko Miletic <darko.miletic at gmail.com>'
|
||||
|
||||
'''
|
||||
Inteligencer.ca
|
||||
'''
|
||||
|
||||
from calibre.web.feeds.news import BasicNewsRecipe
|
||||
|
||||
class Inteligencer(BasicNewsRecipe):
|
||||
title = u'Intelligencer'
|
||||
oldest_article = 7
|
||||
max_articles_per_feed = 100
|
||||
encoding = 'utf-8'
|
||||
language = _('English')
|
||||
no_stylesheets = True
|
||||
use_embedded_content = False
|
||||
lang = 'en-CA'
|
||||
|
||||
conversion_options = {
|
||||
'language' : lang
|
||||
, 'pretty_print' : True
|
||||
}
|
||||
|
||||
remove_attributes = ['style','width','height','font','border','align','action','onload']
|
||||
|
||||
keep_only_tags = [dict(name='td',attrs={'colspan':'2'})]
|
||||
|
||||
remove_tags = [
|
||||
dict(name=['object','link','embed','iframe'])
|
||||
,dict(name='div',attrs={'id':'header'})
|
||||
]
|
||||
feeds = [(u'Recent News', u'http://www.intelligencer.ca/rss/')]
|
||||
|
||||
def print_version(self, url):
|
||||
return url.replace('/ArticleDisplay.aspx?','/PrintArticle.aspx?')
|
||||
|
||||
def preprocess_html(self, soup):
|
||||
for item in soup.findAll('td'):
|
||||
del item['colspan']
|
||||
item.name = 'div'
|
||||
return soup
|
||||
|
Loading…
x
Reference in New Issue
Block a user