From 4e9f2253024b8e800114db0628b63e0feecb8a0b Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 19 Jun 2011 12:00:23 -0600 Subject: [PATCH] Fix #799481 (Updated recipe for Perfil) --- recipes/perfil.recipe | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/recipes/perfil.recipe b/recipes/perfil.recipe index 1104202318..af7072c6f6 100644 --- a/recipes/perfil.recipe +++ b/recipes/perfil.recipe @@ -26,6 +26,7 @@ class Perfil(BasicNewsRecipe): .foto1 h1{font-size: x-small} h1{font-family: Georgia,"Times New Roman",serif} img{margin-bottom: 0.4em} + .hora{font-size: x-small; color: red} """ conversion_options = { @@ -60,7 +61,26 @@ class Perfil(BasicNewsRecipe): ,(u'Tecnologia' , u'http://www.perfil.com/rss/tecnologia.xml' ) ] + def get_article_url(self, article): + return article.get('guid', None) + def preprocess_html(self, soup): for item in soup.findAll(style=True): del item['style'] + for item in soup.findAll('a'): + limg = item.find('img') + if item.string is not None: + str = item.string + item.replaceWith(str) + else: + if limg: + item.name = 'div' + item.attrs = [] + else: + str = self.tag_to_string(item) + item.replaceWith(str) + for item in soup.findAll('img'): + if not item.has_key('alt'): + item['alt'] = 'image' return soup + \ No newline at end of file