New recipe for The Intelligencer by Darko Miletic

This commit is contained in:
Kovid Goyal 2009-08-27 21:23:14 -06:00
parent 6b4be93c10
commit b34bdd60cd
3 changed files with 48 additions and 0 deletions

View File

@ -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('***',

View File

@ -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',
)]

View 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