4
__copyright__ = '2009, Darko Miletic <darko.miletic at gmail.com>'
9
from calibre.web.feeds.news import BasicNewsRecipe
10
from calibre.ebooks.BeautifulSoup import BeautifulSoup, Tag
12
class LaTribuna(BasicNewsRecipe):
13
title = 'La Tribuna - Honduras'
14
__author__ = 'Darko Miletic'
15
description = 'Noticias de Honduras y mundo'
16
publisher = 'La Tribuna'
17
category = 'news, politics, Honduras'
19
max_articles_per_feed = 100
20
use_embedded_content = False
22
remove_javascript = True
24
language = _('Spanish')
29
'--comment', description
30
, '--category', category
31
, '--publisher', publisher
34
html2epub_options = 'publisher="' + publisher + '"\ncomments="' + description + '"\ntags="' + category + '"\npretty_print=True\noverride_css=" p {text-indent: 0cm; margin-top: 0em; margin-bottom: 0.5em} "'
36
remove_tags = [dict(name=['form','object','embed'])]
39
dict(name='p', attrs={'id':['BlogTitle','BlogDate']})
40
,dict(name='div', attrs={'id':'BlogContent'})
43
feeds = [(u'Noticias', u'http://www.latribuna.hn/web2.0/?feed=rss')]
45
def print_version(self, url):
46
return url + '&print=1'
48
def preprocess_html(self, soup):
49
soup.html['lang'] = self.lang
50
soup.html['dir' ] = self.direction
51
mlang = Tag(soup,'meta',[("http-equiv","Content-Language"),("content",self.lang)])
52
mcharset = Tag(soup,'meta',[("http-equiv","Content-Type"),("content","text/html; charset=utf-8")])
53
soup.head.insert(0,mlang)
54
soup.head.insert(1,mcharset)
55
for item in soup.findAll(style=True):
59
def get_cover_url(self):
61
soup = self.index_to_soup('http://www.latribuna.hn/web2.0/')
62
cover_item = soup.find('div',attrs={'class':'portada_impresa'})
64
cover_url = cover_item.a.img['src']