2
# -*- coding: utf-8 -*-
5
__copyright__ = '2009, Darko Miletic <darko.miletic at gmail.com>'
10
from calibre.web.feeds.news import BasicNewsRecipe
11
from calibre.ebooks.BeautifulSoup import Tag
13
class LaVanguardia(BasicNewsRecipe):
14
title = 'La Vanguardia Digital'
15
__author__ = 'Darko Miletic'
16
description = u'Noticias desde España'
17
publisher = 'La Vanguardia'
18
category = 'news, politics, Spain'
20
max_articles_per_feed = 100
22
use_embedded_content = False
25
language = _('Spanish')
29
'--comment' , description
30
, '--category' , category
31
, '--publisher', publisher
34
html2epub_options = 'publisher="' + publisher + '"\ncomments="' + description + '"\ntags="' + category + '"'
37
(u'Ciudadanos' , u'http://feeds.feedburner.com/lavanguardia/ciudadanos' )
38
,(u'Cultura' , u'http://feeds.feedburner.com/lavanguardia/cultura' )
39
,(u'Deportes' , u'http://feeds.feedburner.com/lavanguardia/deportes' )
40
,(u'Economia' , u'http://feeds.feedburner.com/lavanguardia/economia' )
41
,(u'El lector opina' , u'http://feeds.feedburner.com/lavanguardia/lectoropina' )
42
,(u'Gente y TV' , u'http://feeds.feedburner.com/lavanguardia/gente' )
43
,(u'Internacional' , u'http://feeds.feedburner.com/lavanguardia/internacional')
44
,(u'Internet y tecnologia', u'http://feeds.feedburner.com/lavanguardia/internet' )
45
,(u'Motor' , u'http://feeds.feedburner.com/lavanguardia/motor' )
46
,(u'Politica' , u'http://feeds.feedburner.com/lavanguardia/politica' )
47
,(u'Sucessos' , u'http://feeds.feedburner.com/lavanguardia/sucesos' )
52
dict(name='div', attrs={'class':'element1_3'})
56
dict(name=['object','link','script'])
57
,dict(name='div', attrs={'class':['colC','peu']})
60
remove_tags_after = [dict(name='div', attrs={'class':'text'})]
62
def preprocess_html(self, soup):
63
soup.html['dir' ] = self.direction
64
mcharset = Tag(soup,'meta',[("http-equiv","Content-Type"),("content","text/html; charset=utf-8")])
65
soup.head.insert(0,mcharset)
66
for item in soup.findAll(style=True):