Improved recipe for HRT: Vesti

This commit is contained in:
Kovid Goyal 2009-12-14 09:46:24 -07:00
parent fad5a44ccf
commit d5f369ce8b
3 changed files with 13 additions and 3 deletions

View File

@ -11,6 +11,8 @@ import re
from calibre.web.feeds.news import BasicNewsRecipe
from calibre.ebooks.BeautifulSoup import Tag
adfad
class HRT(BasicNewsRecipe):
title = 'HRT: Vesti'
__author__ = 'Darko Miletic'
@ -23,7 +25,14 @@ class HRT(BasicNewsRecipe):
language = 'hr'
lang = 'hr-HR'
extra_css = '@font-face {font-family: "serif1";src:url(res:///opt/sony/ebook/FONT/tt0011m_.ttf)} body{font-family: serif1, serif} .article_description{font-family: serif1, serif}'
extra_css = '''@font-face {font-family: "serif1";src:url(res:///opt/sony/ebook/FONT/tt0011m_.ttf)}
body{font-family: serif1, serif} .article_description{font-family: serif1, serif}
.news-single-timedata{color:#20558A; font-size:x-small;}
.nsTitle{color:#20558A; font-size:large; font-weight:bold;}
a{color:#20558A;}
.external-link-new-window{color:#20558A;}
'''
conversion_options = {
'comment' : description
@ -36,6 +45,7 @@ class HRT(BasicNewsRecipe):
preprocess_regexps = [(re.compile(u'\u0110'), lambda match: u'\u00D0')]
keep_only_tags = [dict(name='div', attrs={'class':'bigVijest'})]
remove_tags = [dict(name=['object','link','embed'])]

View File

@ -196,7 +196,7 @@ class InputFormatPlugin(Plugin):
def __call__(self, stream, options, file_ext, log,
accelerators, output_dir):
log('InputFormatPlugin: %s running'%self.name, end=' ')
log('InputFormatPlugin: %s running'%self.name)
if hasattr(stream, 'name'):
log('on', stream.name)

View File

@ -60,7 +60,7 @@ class RecipeInput(InputFormatPlugin):
log.warn(
'Downloaded recipe needs calibre version at least: %s' % \
recipe.requires_version)
builtin = True
builtin = True
except:
log.exception('Failed to compile downloaded recipe. Falling '
'back to builtin one')