From 931d46cd84761f55372adbe4ca04a1ffe2d6b73a Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 20 Mar 2012 20:47:51 +0530 Subject: [PATCH] Ivana Milakovic by Darko Miletic. Fixes #960279 (New recipe for blog Ivana Milakovic) --- recipes/ivanamilakovic.recipe | 43 +++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 recipes/ivanamilakovic.recipe diff --git a/recipes/ivanamilakovic.recipe b/recipes/ivanamilakovic.recipe new file mode 100644 index 0000000000..34e00a7ed8 --- /dev/null +++ b/recipes/ivanamilakovic.recipe @@ -0,0 +1,43 @@ +# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai + +__license__ = 'GPL v3' +__copyright__ = '2012, Darko Miletic ' +''' +ivanamilakovic.blogspot.com +''' + +import re +from calibre.web.feeds.news import BasicNewsRecipe + +class IvanaMilakovic(BasicNewsRecipe): + title = u'Ivana Milaković' + __author__ = 'Darko Miletic' + description = u'Hronika mačijeg škrabala - priče, inspiracija, knjige, pisanje, prevodi...' + oldest_article = 80 + max_articles_per_feed = 100 + language = 'sr' + encoding = 'utf-8' + no_stylesheets = True + use_embedded_content = True + publication_type = 'blog' + extra_css = """ + @font-face {font-family: "sans1";src:url(res:///opt/sony/ebook/FONT/tt0003m_.ttf)} + body{font-family: Arial,Tahoma,Helvetica,FreeSans,sans1,sans-serif} + img{margin-bottom: 0.8em; border: 1px solid #333333; padding: 4px } + """ + + conversion_options = { + 'comment' : description + , 'tags' : 'knjige, blog, srbija, sf' + , 'publisher': 'Ivana Milakovic' + , 'language' : language + } + + preprocess_regexps = [(re.compile(u'\u0110'), lambda match: u'\u00D0')] + + feeds = [(u'Posts', u'http://ivanamilakovic.blogspot.com/feeds/posts/default')] + + def preprocess_html(self, soup): + for item in soup.findAll(style=True): + del item['style'] + return self.adeify_images(soup)