From 53b43f6e0ca4d97345eab420d8de39671cddb84f Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 3 May 2013 09:44:47 +0530 Subject: [PATCH] Diario Extra by Douglas Delgado --- recipes/diario_extra.recipe | 47 +++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 recipes/diario_extra.recipe diff --git a/recipes/diario_extra.recipe b/recipes/diario_extra.recipe new file mode 100644 index 0000000000..b7af9d0b2f --- /dev/null +++ b/recipes/diario_extra.recipe @@ -0,0 +1,47 @@ +from calibre.web.feeds.news import BasicNewsRecipe + + +class goonews(BasicNewsRecipe): + __author__ = 'Douglas Delgado' + title = u'Diario Extra' + publisher = 'Sociedad Periodistica Extra Limitada' + description = 'Diario de circulacion nacional de Costa Rica.' + category = 'Spanish, Entertainment' + masthead_url = 'http://www.diarioextra.com/img/apariencia/logo.png' + + oldest_article = 7 + delay = 1 + max_articles_per_feed = 100 + auto_cleanup = True + encoding = 'utf-8' + language = 'es_CR' + use_embedded_content = False + remove_empty_feeds = True + remove_javascript = True + no_stylesheets = True + + feeds = [(u'Nacionales', + u'http://www.diarioextra.com/includes/rss_text.php?id=1'), + (u'Internacionales', + u'http://www.diarioextra.com/includes/rss_text.php?id=2'), + (u'Sucesos', + u'http://www.diarioextra.com/includes/rss_text.php?id=3'), + (u'Deportes', + u'http://www.diarioextra.com/includes/rss_text.php?id=6'), + (u'Espectaculos', + u'http://www.diarioextra.com/includes/rss_text.php?id=7'), + (u'Opinion', + u'http://www.diarioextra.com/includes/rss_text.php?id=4')] + + def get_cover_url(self): + index = 'http://kiosko.net/cr/np/cr_extra.html' + soup = self.index_to_soup(index) + for image in soup.findAll('img', src=True): + if image['src'].endswith('cr_extra.750.jpg'): + return image['src'] + return None + + extra_css = ''' + h1{font-family:Arial,Helvetica,sans-serif; font-weight:bold;font-size:30px;} + h2{font-family:Arial,Helvetica,sans-serif; font-weight:normal; font-style:italic; font-size:18px;} + '''