Debian Codegraph @

recipes/tabu.recipe

raw
1 #!/usr/bin/env python
2 # -*- coding: utf-8 -*-
3
4 __license__ = 'GPL v3'
5 __copyright__ = '2011, Silviu Cotoar\u0103'
6 '''
7 tabu.ro
8 '''
9
10 from calibre.web.feeds.news import BasicNewsRecipe
11
12
13 class TabuRo(BasicNewsRecipe):
14 title = 'Tabu'
15 __author__ = 'Silviu Cotoar\u0103'
16 description = 'Cel mai curajos site de femei'
17 publisher = 'Tabu'
18 oldest_article = 5
19 language = 'ro'
20 max_articles_per_feed = 100
21 no_stylesheets = True
22 use_embedded_content = False
23 category = 'Ziare,Reviste,Femei'
24 encoding = 'utf-8'
25 cover_url = 'http://www.tabu.ro/img/tabu-logo2.png'
26
27 conversion_options = {'comments': description, 'tags': category, 'language': language, 'publisher': publisher}
28
29 keep_only_tags = [
30 dict(name='h2', attrs={'class': 'articol_titlu'}),
31 dict(name='div', attrs={'class': 'poza_articol_featured'}),
32 dict(name='div', attrs={'class': 'articol_text'}),
33 ]
34
35 remove_tags = [dict(name='div', attrs={'class': 'asemanatoare'}), dict(name='div', attrs={'class': 'social'})]
36
37 remove_tags_after = [
38 dict(name='div', attrs={'class': 'social'}),
39 dict(name='div', attrs={'id': 'comments'}),
40 dict(name='div', attrs={'class': 'asemanatoare'}),
41 ]
42
43 feeds = [('Feeds', 'http://www.tabu.ro/feed/')]
44
45 def preprocess_html(self, soup):
46 return self.adeify_images(soup)