From 616764757700fe708170b4186f6628cafd1ee9b8 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 10 Dec 2009 13:31:25 -0700 Subject: [PATCH] New recipe for Rzeczpospolita OnLine by kwetal --- resources/recipes/rzeczpospolita.recipe | 55 +++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 resources/recipes/rzeczpospolita.recipe diff --git a/resources/recipes/rzeczpospolita.recipe b/resources/recipes/rzeczpospolita.recipe new file mode 100644 index 0000000000..9dfa590982 --- /dev/null +++ b/resources/recipes/rzeczpospolita.recipe @@ -0,0 +1,55 @@ +from calibre.web.feeds.news import BasicNewsRecipe + +class RzeczpospolitaRecipe(BasicNewsRecipe): + __license__ = 'GPL v3' + __author__ = 'kwetal' + language = 'pl' + version = 1 + + title = u'Rzeczpospolita OnLine' + publisher = u'Presspublica Sp.' + category = u'News' + description = u'Newspaper' + oldest_article = 1 + max_articles_per_feed = 100 + + no_stylesheets = True + remove_javascript = True + encoding = 'utf-8' + # Seems to work best, but YMMV + simultaneous_downloads = 1 + + feeds = [] + feeds.append(u'http://www.rp.pl/rss/2.html') + feeds.append(u'http://www.rp.pl/rss/10.html') + feeds.append(u'http://www.rp.pl/rss/11.html') + feeds.append(u'http://www.rp.pl/rss/12.html') + feeds.append(u'http://www.rp.pl/rss/4.html') + feeds.append(u'http://www.rp.pl/rss/5.html') + feeds.append(u'http://www.rp.pl/rss/6.html') + feeds.append(u'http://www.rp.pl/rss/7.html') + feeds.append(u'http://www.rp.pl/rss/8.html') + + keep_only_tags =[] + keep_only_tags.append(dict(name = 'div', attrs = {'id' : 'storyp'})) + + remove_tags =[] + remove_tags.append(dict(name = 'div', attrs = {'id' : 'adk_0'})) + remove_tags.append(dict(name = 'div', attrs = {'class' : 'clr'})) + remove_tags.append(dict(name = 'div', attrs = {'id' : 'share_bottom'})) + remove_tags.append(dict(name = 'div', attrs = {'id' : 'copyright_law'})) + + extra_css = ''' + body {font-family: verdana, arial, helvetica, geneva, sans-serif ;} + h1{text-align: left;} + h2{font-size: medium; font-weight: bold;} + p.lead {font-weight: bold; text-align: left;} + .authordate {font-size: small; color: #696969;} + .fot{font-size: x-small; color: #666666;} + ''' + + def print_version(self, url): + start, sep, rest = url.rpartition('/') + forget, sep, index = rest.rpartition(',') + + return start + '/' + index + '?print=tak'