From b8f08346b52994da795a9865bf2d8697496a489d Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 27 Feb 2011 10:33:24 -0700 Subject: [PATCH] Historia and Buctaras by Silviu Coatara --- resources/images/news/bucataras.png | Bin 0 -> 765 bytes resources/images/news/historiaro.png | Bin 0 -> 521 bytes resources/recipes/bucataras.recipe | 56 +++++++++++++++++++++++++++ resources/recipes/historiaro.recipe | 51 ++++++++++++++++++++++++ 4 files changed, 107 insertions(+) create mode 100644 resources/images/news/bucataras.png create mode 100644 resources/images/news/historiaro.png create mode 100644 resources/recipes/bucataras.recipe create mode 100644 resources/recipes/historiaro.recipe diff --git a/resources/images/news/bucataras.png b/resources/images/news/bucataras.png new file mode 100644 index 0000000000000000000000000000000000000000..fae90e17c4366b5accc5668256f5234effee9f84 GIT binary patch literal 765 zcmVI>y9+ zP1{Jz+)n3m&Ug8_Xo5WZ_j&Wa>igYY0YCr+q99R*%)r%!CPmgHc!yTt1O{`@(0QgR z;sh*jP#~a0u!$ij(kTj}7sLbvMFY)pu4z|-i-sX!B?@n&0f~|GttPFkL7hPG3C;(c zuW3gA{qlK5b8N~?XYk9B@nd18qHz` zMVjKOIX*_}x<*MPh@%dkne&vj!=c{(0IX5uMssC(nY@|f>WUCNK_aoPsC?j+a|{9q z31F}yf{1`pq$n0pbf5i6IiIk4@iLcJmdMivqsf$hIbonPY5^B&B621;n-EEi@bced zetWph%TdX+yvO?c7x?nd9d4|x;DaDK;$p-T(SQ~aBu1iANHEyhoQ<`0a$~suZoyaA zuF(B`haZ0a6{8{524fU(meUd=N@*IYWmZmkynD#EkG2?`PI$6k((PA#a^q9(-h0S{ zpSCE_w5%n!381k7Ax$iW7uM#-tiNN}?^PTPhlozN-`(TUUp*EUVRPpX-pey?ef$x} z?ShzP*jC=eD8s5KK4>gKTi7^%j#qv{r(tMin$hSr%}gjm}%sH?W`G{v4Aec$2X5;dPG3-*I6! zq1nDjQ8dYmMV|NmhIu5>2~m57qX7>dKjUcBN8P>uja1R`dU(QWa*lRpnL5j4Qqjs6 vXyhIGr(-rZpY!72fU#4gse;5K^_>3zn;>=X(V!n600000NkvXXu0mjfoBnR* literal 0 HcmV?d00001 diff --git a/resources/images/news/historiaro.png b/resources/images/news/historiaro.png new file mode 100644 index 0000000000000000000000000000000000000000..c9e616c8761974bdafca3acb1f3302a1ea8b5238 GIT binary patch literal 521 zcmV+k0`~ohP)O3DDx0nRYNXo8)H%u0d@zJVk*42e%coZt(nZ=p27N$UtlEeV$y zGU$Y+QYO75J=eXQ&{JD`T$8=`%G%$be_yP@V4!NH!jEc|PNzc{1gsVcY;L}0`N=W> z^;(VZhlgDLy2P?AmX;n<+$i#DeH|ppbzObj-xr`q^9yP=n=-~|s4xt5Tt5~dK;?t7 zf*_D2F$|raoCwg)yONT$`s}&#GdcBoz1Xw4mFv0y_`Xk)jD&65c%Bz~F+jtRF^K?f z0gmnb3mD3>tYm;SF-`+Gjx%YE!nT8?F)#HuJahLRXQyYp-`&M?JtPBIq*5uODB}A1 zH~D;iIzWIQ1}r{YU7`8@S|h zGb7XYeVw15Yo}BapxOHmbnx|?TCG<6-W!dEzI^%|f2I$6d%C!|kTFJ9x7$^@T&8(- z#aw=lUblzqxfC~wyeJd^s8%Y}Yc*zav!v50ZrV4jJY8XH>kWSZgq{$j2O3Ch00000 LNkvXXu0mjfVkGfv literal 0 HcmV?d00001 diff --git a/resources/recipes/bucataras.recipe b/resources/recipes/bucataras.recipe new file mode 100644 index 0000000000..b069ecc5b0 --- /dev/null +++ b/resources/recipes/bucataras.recipe @@ -0,0 +1,56 @@ +# -*- coding: utf-8 -*- +#!/usr/bin/env python + +__license__ = 'GPL v3' +__copyright__ = u'2011, Silviu Cotoar\u0103' +''' +bucataras.ro +''' + +from calibre.web.feeds.news import BasicNewsRecipe + +class Bucataras(BasicNewsRecipe): + title = u'Bucataras' + __author__ = u'Silviu Cotoar\u0103' + description = '' + publisher = 'Bucataras' + oldest_article = 5 + language = 'ro' + max_articles_per_feed = 100 + no_stylesheets = True + use_embedded_content = False + category = 'Ziare,Bucatarie,Retete' + encoding = 'utf-8' + cover_url = 'http://www.bucataras.ro/templates/default/images/pink/logo.jpg' + + conversion_options = { + 'comments' : description + ,'tags' : category + ,'language' : language + ,'publisher' : publisher + } + + keep_only_tags = [ + dict(name='h1', attrs={'class':'titlu'}) + , dict(name='div', attrs={'class':'contentL'}) + , dict(name='div', attrs={'class':'contentBottom'}) + + ] + + remove_tags = [ + dict(name='div', attrs={'class':['sociale']}) + , dict(name='div', attrs={'class':['contentR']}) + , dict(name='a', attrs={'target':['_self']}) + , dict(name='div', attrs={'class':['comentarii']}) + ] + + remove_tags_after = [ + dict(name='div', attrs={'class':['comentarii']}) + ] + + feeds = [ + (u'Feeds', u'http://www.bucataras.ro/rss/retete/') + ] + + def preprocess_html(self, soup): + return self.adeify_images(soup) diff --git a/resources/recipes/historiaro.recipe b/resources/recipes/historiaro.recipe new file mode 100644 index 0000000000..98eb5b6dfe --- /dev/null +++ b/resources/recipes/historiaro.recipe @@ -0,0 +1,51 @@ +# -*- coding: utf-8 -*- +#!/usr/bin/env python + +__license__ = 'GPL v3' +__copyright__ = u'2011, Silviu Cotoar\u0103' +''' +historia.ro +''' + +from calibre.web.feeds.news import BasicNewsRecipe + +class HistoriaRo(BasicNewsRecipe): + title = u'Historia' + __author__ = u'Silviu Cotoar\u0103' + description = '' + publisher = 'Historia' + oldest_article = 5 + language = 'ro' + max_articles_per_feed = 100 + no_stylesheets = True + use_embedded_content = False + category = 'Ziare,Reviste,Istorie' + encoding = 'utf-8' + cover_url = 'http://www.historia.ro/sites/all/themes/historia/images/historia.png' + + conversion_options = { + 'comments' : description + ,'tags' : category + ,'language' : language + ,'publisher' : publisher + } + + keep_only_tags = [ + dict(name='div', attrs={'class':'c_antet_title'}) + , dict(name='a', attrs={'class':'overlaybox'}) + , dict(name='div', attrs={'class':'art_content'}) + ] + + remove_tags = [ + dict(name='div', attrs={'class':['fl_left']}) + , dict(name='div', attrs={'id':['article_toolbar']}) + , dict(name='div', attrs={'class':['zoom_cont']}) + ] + + + feeds = [ + (u'Feeds', u'http://www.historia.ro/rss.xml') + ] + + def preprocess_html(self, soup): + return self.adeify_images(soup)