Debian Codegraph @

recipes/nspm_int.recipe

raw
1 __license__ = 'GPL v3'
2 __copyright__ = '2008-2010, Darko Miletic <darko.miletic at gmail.com>'
3 '''
4 nspm.rs/nspm-in-english
5 '''
6
7 from calibre.web.feeds.news import BasicNewsRecipe
8
9
10 class Nspm_int(BasicNewsRecipe):
11 title = 'NSPM in English'
12 __author__ = 'Darko Miletic'
13 description = 'Magazine dedicated to political theory and sociological research'
14 publisher = 'NSPM'
15 category = 'news, politics, Serbia'
16 oldest_article = 7
17 max_articles_per_feed = 100
18 no_stylesheets = True
19 use_embedded_content = False
20 encoding = 'utf-8'
21 language = 'en'
22 delay = 2
23 publication_type = 'magazine'
24 masthead_url = 'http://www.nspm.rs/templates/jsn_epic_pro/images/logol.jpg'
25 extra_css = '''
26 body{font-family: "Times New Roman", serif}
27 .article_description{font-family: Arial, sans-serif}
28 img{margin-top:0.5em; margin-bottom: 0.7em}
29 .author{color: #990000; font-weight: bold}
30 .author,.createdate{font-size: 0.9em} '''
31
32 conversion_options = {'comment': description, 'tags': category, 'publisher': publisher, 'language': language, 'linearize_tables': True}
33
34 keep_only_tags = [dict(attrs={'id': 'jsn-mainbody'})]
35 remove_tags = [dict(name=['link', 'object', 'embed', 'script', 'meta', 'base', 'iframe']), dict(attrs={'class': 'buttonheading'})]
36 remove_tags_after = dict(attrs={'class': 'article_separator'})
37 remove_attributes = ['width', 'height']
38
39 feeds = [('Articles', 'http://www.nspm.rs/nspm-in-english/feed/rss.html')]
40
41 def preprocess_html(self, soup):
42 for item in soup.body.findAll(style=True):
43 del item['style']
44 return self.adeify_images(soup)