From 517448c1b1a72be102e1f59c9b185f51892bfa09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20D=C5=82ugosz?= Date: Thu, 4 Apr 2013 21:15:23 +0200 Subject: [PATCH] add wysokie obcasy --- recipes/icons/wysokie_obcasy.png | Bin 0 -> 205 bytes recipes/wysokie_obcasy.recipe | 58 +++++++++++++++++++++++++++++++ 2 files changed, 58 insertions(+) create mode 100644 recipes/icons/wysokie_obcasy.png create mode 100644 recipes/wysokie_obcasy.recipe diff --git a/recipes/icons/wysokie_obcasy.png b/recipes/icons/wysokie_obcasy.png new file mode 100644 index 0000000000000000000000000000000000000000..3ab94b3c66467a977b7409e32c9cc2b9d8bb8990 GIT binary patch literal 205 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!73?$#)eFPFP2=EDU{r~^}MF#T=3>H^K+%GX$ zTwpN1ZIp1C!SoWN)sO2Bem{S686<0VMa2DSdgrUQg=>CKoB`C!SQ6wH%;50sMjDXg z?djqe!Z9;BL4oa$DH~I@!sE${7A#m`GvVWMfm1)8ti7@&Q2xXW>5$+@Nt`JgST(ui zb~2FVdQ&MBb@0ChW1 AL;wH) literal 0 HcmV?d00001 diff --git a/recipes/wysokie_obcasy.recipe b/recipes/wysokie_obcasy.recipe new file mode 100644 index 0000000000..40c8cf60a9 --- /dev/null +++ b/recipes/wysokie_obcasy.recipe @@ -0,0 +1,58 @@ +#!/usr/bin/env python +__license__ = 'GPL v3' +import re + +from calibre.web.feeds.news import BasicNewsRecipe + +class WysokieObcasyRecipe(BasicNewsRecipe): + __author__ = u'Artur Stachecki ' + language = 'pl' + version = 1 + + title = u'Wysokie Obcasy' + publisher = 'Agora SA' + description = u'Serwis sobotniego dodatku do Gazety Wyborczej' + category='magazine' + language = 'pl' + publication_type = 'magazine' + cover_url='' + remove_empty_feeds= True + no_stylesheets=True + oldest_article = 7 + max_articles_per_feed = 100000 + recursions = 0 + + no_stylesheets = True + remove_javascript = True + simultaneous_downloads = 5 + + keep_only_tags =[] + keep_only_tags.append(dict(name = 'div', attrs = {'id' : 'article'})) + + remove_tags =[] + remove_tags.append(dict(name = 'img')) + remove_tags.append(dict(name = 'p', attrs = {'class' : 'info'})) + + extra_css = ''' + body {font-family: verdana, arial, helvetica, geneva, sans-serif ;} + h1{text-align: left;} + ''' + + feeds = [ + ('Wszystkie Artykuly', 'feed://www.wysokieobcasy.pl/pub/rss/wysokieobcasy.xml'), + ] + + def print_version(self,url): + baseURL='http://www.wysokieobcasy.pl/wysokie-obcasy' + segments = url.split(',') + subPath= '/2029020,' + articleURL1 = segments[1] + articleURL2 = segments[2] + printVerString=articleURL1 + ',' + articleURL2 + s= baseURL + subPath + printVerString + '.html' + return s + + def get_cover_url(self): + soup = self.index_to_soup('http://www.wysokieobcasy.pl/wysokie-obcasy/0,0.html') + self.cover_url = soup.find(attrs={'class':'holder_cr'}).find('img')['src'] + return getattr(self, 'cover_url', self.cover_url) \ No newline at end of file