4
__copyright__ = '2009, Darko Miletic <darko.miletic at gmail.com>'
11
from calibre.web.feeds.recipes import BasicNewsRecipe
13
class DnevnikCro(BasicNewsRecipe):
14
title = 'Dnevnik - Hr'
15
__author__ = 'Darko Miletic'
16
description = "Vijesti iz Hrvatske"
17
publisher = 'Dnevnik.hr'
18
category = 'news, politics, Croatia'
20
max_articles_per_feed = 100
24
use_embedded_content = False
25
remove_javascript = True
26
language = _('Croatian')
28
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}'
31
'--comment', description
32
, '--category', category
33
, '--publisher', publisher
37
html2epub_options = 'publisher="' + publisher + '"\ncomments="' + description + '"\ntags="' + category + '"\nlinearize_tables=True'
39
preprocess_regexps = [(re.compile(u'\u0110'), lambda match: u'\u00D0')]
41
keep_only_tags = [dict(name='div', attrs={'id':'article'})]
44
dict(name=['object','link','embed'])
45
,dict(name='div', attrs={'class':'menu'})
46
,dict(name='div', attrs={'id':'video'})
49
remove_tags_after = dict(name='div', attrs={'id':'content'})
51
feeds = [(u'Vijesti', u'http://rss.dnevnik.hr/index.rss')]
53
def preprocess_html(self, soup):
54
soup.html['lang'] = 'hr-HR'
55
mtag = '<meta http-equiv="Content-Language" content="hr-HR"/>\n<meta http-equiv="Content-Type" content="text/html; charset=utf-8">'
56
soup.head.insert(0,mtag)
57
for item in soup.findAll(style=True):