Debian Codegraph @

recipes/financiarul.recipe

raw
1 #!/usr/bin/env python
2 # -*- coding: utf-8 -*-
3
4 __license__ = 'GPL v3'
5 __copyright__ = '2011, Silviu Cotoar\u0103'
6 '''
7 financiarul.com
8 '''
9
10 from calibre.web.feeds.news import BasicNewsRecipe
11
12
13 class Financiarul(BasicNewsRecipe):
14 title = 'Financiarul'
15 __author__ = 'Silviu Cotoar\u0103'
16 description = 'FIN.ro'
17 publisher = 'Financiarul'
18 oldest_article = 25
19 language = 'ro'
20 max_articles_per_feed = 100
21 no_stylesheets = True
22 use_embedded_content = False
23 category = 'Ziare,Stiri'
24 encoding = 'utf-8'
25 cover_url = 'http://www.financiarul.com/templates/default/images/logo.png'
26
27 conversion_options = {'comments': description, 'tags': category, 'language': language, 'publisher': publisher}
28
29 keep_only_tags = [dict(name='div', attrs={'class': 'col2ContentLeftL'})]
30
31 remove_tags = [
32 dict(name='div', attrs={'class': ['infoArticol']}),
33 dict(name='ul', attrs={'class': 'navSectiuni'}),
34 dict(name='div', attrs={'class': 'separator separatorTop'}),
35 dict(name='div', attrs={'class': 'infoArticol infoArticolBottom'}),
36 dict(name='ul', attrs={'class': ['related']}),
37 dict(name='div', attrs={'class': ['slot panel300 panelGri300 panelGri300s panelGri300sm']}), # noqa: E501
38 ]
39
40 remove_tags_after = [dict(name='ul', attrs={'class': ['related']})]
41
42 feeds = [('Feeds', 'http://www.financiarul.com/rss')]
43
44 def preprocess_html(self, soup):
45 return self.adeify_images(soup)