From 1fdac7d5a014ca2f73e7cf855126c65ed1d20a5d Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 20 Aug 2011 11:46:08 -0600 Subject: [PATCH] Cvece Zla by Darko Miletic. Fixes #830143 (New recipe for serbian blog Cvece Zla) --- recipes/cvecezla.recipe | 47 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 recipes/cvecezla.recipe diff --git a/recipes/cvecezla.recipe b/recipes/cvecezla.recipe new file mode 100644 index 0000000000..712c898a3e --- /dev/null +++ b/recipes/cvecezla.recipe @@ -0,0 +1,47 @@ + +__license__ = 'GPL v3' +__copyright__ = '2011, Darko Miletic ' +''' +cvecezla.wordpress.com +''' + +import re +from calibre.web.feeds.news import BasicNewsRecipe + +class CveceZla(BasicNewsRecipe): + title = 'Cvece zla i naopakog' + __author__ = 'Darko Miletic' + description = 'Haoticnost razmisljanja poradja haoticnost pisanja. Muzika, stripovi, igre, knjige, generalno glupiranje...' + oldest_article = 7 + max_articles_per_feed = 100 + language = 'sr' + encoding = 'utf-8' + no_stylesheets = True + use_embedded_content = False + publication_type = 'blog' + extra_css = ' @font-face {font-family: "serif1";src:url(res:///opt/sony/ebook/FONT/tt0011m_.ttf)} @font-face {font-family: "sans1";src:url(res:///opt/sony/ebook/FONT/tt0003m_.ttf)} body{font-family: "Trebuchet MS",Trebuchet,Verdana,sans1,sans-serif} .article_description{font-family: sans1, sans-serif} img{display: block } ' + + conversion_options = { + 'comment' : description + , 'tags' : 'igre, muzika, film, blog, Srbija' + , 'publisher': 'Mehmet Krljic' + , 'language' : language + } + + preprocess_regexps = [(re.compile(u'\u0110'), lambda match: u'\u00D0')] + + remove_tags_before = dict(attrs={'class':'navigation'}) + remove_tags_after = dict(attrs={'class':'commentlist'}) + remove_tags = [ + dict(attrs={'class':['postmetadata alt','sharedaddy sharedaddy-dark sd-like-enabled sd-sharing-enabled','reply','navigation']}) + ,dict(attrs={'id':'respond'}) + ] + + feeds = [(u'Clanci', u'http://cvecezla.wordpress.com/feed/')] + + def preprocess_html(self, soup): + for item in soup.findAll(style=True): + del item['style'] + return soup + +