From 8e8e7ec55884cca2b16e9dc46f460ef16da1ebd0 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 15 Dec 2008 10:12:13 -0800 Subject: [PATCH] New recipe for Liberation (thanks to Darko Miletic) --- src/calibre/gui2/images/news/liberation.png | Bin 0 -> 899 bytes src/calibre/web/feeds/recipes/__init__.py | 2 +- src/calibre/web/feeds/recipes/liberation.py | 38 ++++++++++++++++++++ 3 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 src/calibre/gui2/images/news/liberation.png create mode 100644 src/calibre/web/feeds/recipes/liberation.py diff --git a/src/calibre/gui2/images/news/liberation.png b/src/calibre/gui2/images/news/liberation.png new file mode 100644 index 0000000000000000000000000000000000000000..e6c6d7b8849057abd7ae970c758b807e6f906f3f GIT binary patch literal 899 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdzwj^(N7lwZz_*&vh6HtV+z$3C4 zNPB>>+sSM@kYHJXV>*yl0OR&wbLKKIFs<=)aSVw#{C3)H?+{0s|pCRaa z@$4sEO|M-xE=$v%ExlL$!k_b3`YX+@Bkdo;F1Z?YaZL$|59tZGc%U_XA;zp*Qd+hAzg%KG|7qpJ9%kHLjn`%$TEi?LD8PPg zp_aC%%v#lq*9xU8C#KZeuG*7ynA?@b+}{7oBgw>k{=|IqvMiy_PYZ0PTx(@aT6}-+ zSDQbxlv#RxS#;N`_|JEJe=GFEhh>_^Y`-&S)zs@J`kVh;&V1wM&5FmKc2YH-BIM_{iEkZdqq zandM$gV$VA*Y@c9L%oiHC@oCvDgFn|E+10DbRQRl0J^97Y;5TQ^MCq<6 zIq0t&9_sq&i038Q>z?H?hph_)rh15^-bgi?!LOY1?w;cRCGy5*T`qxh%9md2+HgVU zN8yW#-~1D@cKQ4|6*}p;{(|y%cXsfuJ?iH#{H;{DtW=11?~!w7*H%V9xU-)9;`b9P zHW>*Wf5kB?nj`AA=as7qFQ;zY-reo8K7L~LkA^=7gwOntNIGMc&+VD}HGGed=oYu| zaAA`;wTwK+qMH`mo11s6_l}-bcbiE=LiBz-^Jg28BMhz?r~5BzZ46o+w{B0}Dg9rw z-ZHOg{^|SozWpL02hIonFQm`KZrI_MWWErXfK^LeBTABsQWHy3byI)@gOP!Og|4BI zuAym&p@EfwrIo3Hu7QP>fx%nPHDWLgx%nxXX_c57jIE3etc*+`8bS|pz6EMv@O1Ta JS?83{1OT_OibDVZ literal 0 HcmV?d00001 diff --git a/src/calibre/web/feeds/recipes/__init__.py b/src/calibre/web/feeds/recipes/__init__.py index 6c3c25370f..6d4f399d10 100644 --- a/src/calibre/web/feeds/recipes/__init__.py +++ b/src/calibre/web/feeds/recipes/__init__.py @@ -17,7 +17,7 @@ recipe_modules = [ 'blic', 'novosti', 'danas', 'vreme', 'times_online', 'the_scotsman', 'nytimes_sub', 'security_watch', 'cyberpresse', 'st_petersburg_times', 'clarin', 'financial_times', 'heise', 'le_monde', 'harpers', 'science_aas', - 'science_news', 'the_nation', 'lrb', 'harpers_full' + 'science_news', 'the_nation', 'lrb', 'harpers_full', 'liberation', ] import re, imp, inspect, time, os diff --git a/src/calibre/web/feeds/recipes/liberation.py b/src/calibre/web/feeds/recipes/liberation.py new file mode 100644 index 0000000000..9f85433d11 --- /dev/null +++ b/src/calibre/web/feeds/recipes/liberation.py @@ -0,0 +1,38 @@ +#!/usr/bin/env python + +__license__ = 'GPL v3' +__copyright__ = '2008, Darko Miletic ' +''' +liberation.fr +''' + +from calibre.web.feeds.news import BasicNewsRecipe + +class Liberation(BasicNewsRecipe): + title = u'Liberation' + __author__ = 'Darko Miletic' + description = 'News from France' + oldest_article = 7 + max_articles_per_feed = 100 + no_stylesheets = True + use_embedded_content = False + + html2lrf_options = ['--base-font-size', '10'] + + keep_only_tags = [ + dict(name='h1') + ,dict(name='div', attrs={'class':'articleContent'}) + ,dict(name='div', attrs={'class':'entry'}) + ] + remove_tags = [ + dict(name='p', attrs={'class':'clear'}) + ,dict(name='ul', attrs={'class':'floatLeft clear'}) + ,dict(name='div', attrs={'class':'clear floatRight'}) + ,dict(name='object') + ] + + feeds = [ + (u'La une', u'http://www.liberation.fr/rss/laune') + ,(u'Monde' , u'http://www.liberation.fr/rss/monde') + ,(u'Sports', u'http://www.liberation.fr/rss/sports') + ]