From 30b78c37823b12905f4f5f28865ef5d88ea91779 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 25 Oct 2011 18:57:58 +0530 Subject: [PATCH] Fix #881332 (Updated metro-nl) --- ..._news_nl.png (PNG Image, 16x16 pixels).png | Bin 0 -> 712 bytes recipes/metro_news_nl.recipe | 81 ++++++++++++++++-- 2 files changed, 73 insertions(+), 8 deletions(-) create mode 100644 recipes/icons/metro_news_nl.png (PNG Image, 16x16 pixels).png diff --git a/recipes/icons/metro_news_nl.png (PNG Image, 16x16 pixels).png b/recipes/icons/metro_news_nl.png (PNG Image, 16x16 pixels).png new file mode 100644 index 0000000000000000000000000000000000000000..3b692f6bacdf5044f9456b95cb3363a3bcc2ffda GIT binary patch literal 712 zcmV;(0yq7MP)LIbGK!YB_ zs7Rr}OeiC1J~RsrGu>=DcX4(xFUPZ;OAksQ)kFWc5B@(s`1lcU+VMX}uSo;}Nd(VB zkpY0B!KpzI{{UnOJfD)1x-EZej?pZ{Vne>sLGNfRCP1zE1CS y{(h+;FhkW;9QK zjV7oy$!hKEVb9Hn?fo7%w23QK6msFnurk9>IYs$0#fL`7+RbZ;^mYHGdW86B!AEr+lSfJ96% ztxI2@qWjJ-Rh1s%dEPrd;tl#g`@Iui#?n%B<+~l;>B)lZJTNK%G!#Y4aY-6YO=(3= zhFMbN+GF+GH`%jIStfl(u0FHcQK?}Wn&m)I04QXoF*H+ASaPA|ayS}Zl;X`TuFMQ` z-=MqwL0f*_mgYOnLOiZdH#~m%3^YT7WrMR3UwFEtaPQMMy;TP)Pu8C)wC~Ke=4P5K z6ip6ALaw5+9#20+ab+a~#CTvf;;KJuG#G6emgr1qZhp=e3KUpvYL=_qvp-Rzz0`JV znWR9H6ms-n*nr;`m!$@0)v$kDmZhm^I3_CwT^dW%o2|CG8yEedDR624#HxIyjx>k2G3UKBWn731Rbcm3Bp+JfN#v( |\s)*

|]*>Tweet|]*>||)', re.DOTALL|re.IGNORECASE),lambda match: ''), + (re.compile(r'( |\s\s)+\s*', re.DOTALL|re.IGNORECASE),lambda match: ' '), + (re.compile(r'([\s>])([^\s>]+)(]+) />', re.DOTALL|re.IGNORECASE), + lambda match: match.group(1) + match.group(3) + '>' + match.group(2) + ''), + ] + + def postprocess_html(self, soup, first): + for tag in soup.findAll(lambda tag: tag.name.lower()=='img' and tag.has_key('src')): + iurl = tag['src'] + img = Image() + img.open(iurl) + #width, height = img.size + #print '***img is: ', iurl, '\n****width is: ', width, 'height is: ', height + pw = PixelWand() + img.trim(0) + img.save(iurl) + ''' + #width, height = img.size + #print '***TRIMMED img width is: ', width, 'height is: ', height + left=0 + top=0 + border_color='#ffffff' + width, height = img.size + #print '***retrieved img width is: ', width, 'height is: ', height + height_correction = 1.17 + canvas = create_canvas(width, height*height_correction,border_color) + canvas.compose(img, left, top) + #img = canvas + canvas.save(iurl) + #width, height = canvas.size + #print '***NEW img width is: ', width, 'height is: ', height + ''' + return soup + feeds = [ (u'Binnenland', u'http://www.metronieuws.nl/rss.xml?c=1277377288-3'), (u'Economie', u'http://www.metronieuws.nl/rss.xml?c=1278070988-0'), (u'Den Haag', u'http://www.metronieuws.nl/rss.xml?c=1289013337-3'), (u'Rotterdam', u'http://www.metronieuws.nl/rss.xml?c=1289013337-2'), (u'Amsterdam', u'http://www.metronieuws.nl/rss.xml?c=1289013337-1'), + (u'Buitenland', u'http://www.metronieuws.nl/rss.xml?c=1277377288-4'), (u'Columns', u'http://www.metronieuws.nl/rss.xml?c=1277377288-17'), (u'Entertainment', u'http://www.metronieuws.nl/rss.xml?c=1277377288-2'), (u'Dot', u'http://www.metronieuws.nl/rss.xml?c=1283166782-12'),