From fc2023911f9e885ddaf1ec1cbd9b39c8c396267b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20D=C5=82ugosz?= Date: Sun, 18 Nov 2012 18:48:30 +0100 Subject: [PATCH] antyweb --- recipes/antyweb.recipe | 49 ++++++++++++++++++++++++++++++++++++++ recipes/icons/antyweb.png | Bin 0 -> 668 bytes 2 files changed, 49 insertions(+) create mode 100644 recipes/antyweb.recipe create mode 100644 recipes/icons/antyweb.png diff --git a/recipes/antyweb.recipe b/recipes/antyweb.recipe new file mode 100644 index 0000000000..0b8c5af9f4 --- /dev/null +++ b/recipes/antyweb.recipe @@ -0,0 +1,49 @@ +import re + +from calibre.web.feeds.news import BasicNewsRecipe + +class AntywebRecipe(BasicNewsRecipe): + encoding = 'utf-8' + __license__ = 'GPL v3' + __author__ = u'Artur Stachecki ' + language = 'pl' + version = 1 + title = u'Antyweb' + category = u'News' + description = u'Blog o internecie i nowych technologiach' + cover_url='' + remove_empty_feeds= True + auto_cleanup = False + no_stylesheets=True + use_embedded_content = False + oldest_article = 1 + max_articles_per_feed = 100 + remove_javascript = True + simultaneous_downloads = 3 + + keep_only_tags =[] + keep_only_tags.append(dict(name = 'h1', attrs = { 'class' : 'mm-article-title'})) + keep_only_tags.append(dict(name = 'div', attrs = {'class' : 'mm-article-content'})) + + + remove_tags =[] + remove_tags.append(dict(name = 'h2', attrs = {'class' : 'widgettitle'})) + remove_tags.append(dict(name = 'img', attrs = {'class' : 'alignleft'})) + remove_tags.append(dict(name = 'div', attrs = {'class' : 'float: right;margin-left:1em;margin-bottom: 0.5em;padding-bottom: 3px; width: 72px;'})) + remove_tags.append(dict(name = 'img', attrs = {'src' : 'http://antyweb.pl/wp-content/uploads/2011/09/HOSTERSI_testy_pasek600x30.gif'})) + remove_tags.append(dict(name = 'div', attrs = {'class' : 'podwpisowe'})) + + + extra_css = ''' + body {font-family: verdana, arial, helvetica, geneva, sans-serif ;} + ''' + + feeds = [ + (u'Artykuly', u'feed://feeds.feedburner.com/Antyweb?format=xml'), + ] + def preprocess_html(self, soup): + for alink in soup.findAll('a'): + if alink.string is not None: + tstr = alink.string + alink.replaceWith(tstr) + return soup diff --git a/recipes/icons/antyweb.png b/recipes/icons/antyweb.png new file mode 100644 index 0000000000000000000000000000000000000000..8ca9870f60072171a8822aef03f2c67ddeddc594 GIT binary patch literal 668 zcmV;N0%QG&P) zsc2A?peR)nb0v-DntK!94mXx=9em;N42SdZp7T79kW%uNr@Uzz&;TBek7dQS@rp$% zwvBUlhm*@uxxc4k+dSvJ`0Io6_ddA05glSTBU1YtX)CZ#RINix4&9NBN$r5vOq*hjFO(ZB?U;8&`h{cdV zLsu7HHa7UWv4Lt?bk59>+T0`%i%|n=fEkZtB@*0UUQ#O-{Tl?MQ54{JF2~c;6I~-C zbdQemV|khO!9l9FO=5PIYNbNy@DNp1sX7i`spJ!wk%%va>!Os)eE;^1_~ay~=`>f{ z+w@FL5$^BDYHQ^%(gJ`H2=FeMer)eJ^rsg;l zvRUHO(-e=6P=MOwqfcPAwjzLVZ!cBP<7{`AtDPM_EiF;b=c&3bLf1K4T?NbH@!|pj z)Ji38Z*HV!G&Nx~Hu7;{0mrr}Y;Ex?805pm1Wg?s>@O~&s4C9+Iq6giY1{q}N+mqU zK}acC@92<^&(BEL#VD8Yq{IWvx_qyeeU(}QLf08OIPjgQ1%q&NgIYJxt9cLtp=k)q z@+%ZVX>3F^G$5i;yq6cBAUZb2^T`Qnb2C~bf*KB^hC+W)4~Nl1A#}?^4+PKy0W{Mj z(bp%$YZ`xMGEy^548y=M3^Y}xGa42D3zK+joc{n$!0;i>Ta9r50000