From 0a96cf092d721d5552425227d5821bfa1beca763 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 11 Aug 2011 10:24:04 -0600 Subject: [PATCH] Fix #824490 (New recipe for The Independent) --- recipes/icons/independent.png | Bin 0 -> 343 bytes recipes/independent.recipe | 138 +++++++++++++++++++--------------- 2 files changed, 77 insertions(+), 61 deletions(-) create mode 100644 recipes/icons/independent.png diff --git a/recipes/icons/independent.png b/recipes/icons/independent.png new file mode 100644 index 0000000000000000000000000000000000000000..c3c9c39b696c87762d1f8e670c35603e43597545 GIT binary patch literal 343 zcmV-d0jU0oP)8HSTjMb{^TBZ@~C-OWe#)-HEK@f;r z!!4oLG!0%=4B%>>XVpem;x|FfAbI6n0iTKAmNZ3Em3d-5@zp_q>8h&erWtOfZCl-1 zuWzW5fI+X-_YPb$@;3=4-cB$cPxK*>;?^01`7oxhaqR{^1bJ_9CGRC$$8ivrw_?2y peKp2$nx^st') - body = soup.find(name='body') - body.insert(0, story) - return soup + for item in soup.body.findAll(style=True): + del item['style'] + for item in soup.body.findAll(['author','preform']): + item.name='span' + for item in soup.body.findAll('img'): + if not item.has_key('alt'): + item['alt'] = 'image' + for item in soup.body.findAll('div', attrs={'class':['clear-o','body','photoCaption']}): + item.name = 'p' + for item in soup.body.findAll('div'): + if not item.attrs and not item.contents: + item.extract() + soup2 = BeautifulSoup('t') + soup2.body.replaceWith(soup.body) + return soup2