Debian Codegraph @

recipes/cubadebate.recipe

raw
1 __license__ = 'GPL v3'
2 __copyright__ = '2009-2010, Darko Miletic <darko.miletic at gmail.com>'
3 '''
4 cubadebate.cu
5 '''
6
7 from calibre.web.feeds.news import BasicNewsRecipe
8
9
10 class CubaDebate(BasicNewsRecipe):
11 title = 'CubaDebate'
12 __author__ = 'Darko Miletic'
13 description = 'Contra el Terorismo Mediatico'
14 oldest_article = 15
15 language = 'es_CU'
16 max_articles_per_feed = 100
17 no_stylesheets = True
18 use_embedded_content = False
19 publisher = 'Cubadebate'
20 category = 'news, politics, Cuba'
21 encoding = 'utf-8'
22 masthead_url = 'http://www.cubadebate.cu/wp-content/themes/cubadebate/images/logo.gif'
23 publication_type = 'newsportal'
24 extra_css = '''
25 #BlogTitle{font-size: xx-large; font-weight: bold}
26 body{font-family: Verdana, Arial, Tahoma, sans-serif}
27 '''
28
29 conversion_options = {'comments': description, 'tags': category, 'language': language, 'publisher': publisher}
30
31 keep_only_tags = [dict(name='div', attrs={'id': 'Outline'})]
32 remove_tags_after = dict(name='div', attrs={'id': 'BlogContent'})
33 remove_tags = [dict(name=['link', 'base', 'embed', 'object', 'meta', 'iframe']), dict(attrs={'id': 'addthis_container'})]
34
35 feeds = [('Articulos', 'http://www.cubadebate.cu/feed/')]
36 remove_attributes = ['width', 'height', 'lang']
37
38 def print_version(self, url):
39 return url + 'print/'
40
41 def preprocess_html(self, soup):
42 for item in soup.findAll(style=True):
43 del item['style']
44 for item in soup.findAll('img', alt=False):
45 item['alt'] = 'image'
46 return soup