| 1 |
from calibre.web.feeds.news import BasicNewsRecipe |
| 2 |
|
| 3 |
|
| 4 |
class crnews(BasicNewsRecipe): |
| 5 |
__author__ = 'Douglas Delgado' |
| 6 |
title = 'La Nacion Costa Rica' |
| 7 |
publisher = 'GRUPO NACION GN, S. A.' |
| 8 |
description = ( |
| 9 |
'Diario de circulacion nacional de Costa Rica. Recipe creado por Douglas Delgado ([email protected]) para su uso con Calibre por Kovid Goyal' # noqa: E501 |
| 10 |
) |
| 11 |
category = 'Spanish, Entertainment' |
| 12 |
masthead_url = 'http://www.nacion.com/App_Themes/nacioncom/Images/logo_nacioncom.png' |
| 13 |
|
| 14 |
oldest_article = 7 |
| 15 |
delay = 1 |
| 16 |
max_articles_per_feed = 100 |
| 17 |
auto_cleanup = True |
| 18 |
encoding = 'utf-8' |
| 19 |
language = 'es_CR' |
| 20 |
use_embedded_content = False |
| 21 |
remove_empty_feeds = True |
| 22 |
remove_javascript = True |
| 23 |
no_stylesheets = True |
| 24 |
|
| 25 |
feeds = [ |
| 26 |
('Portada', 'http://www.nacion.com/rss/'), |
| 27 |
('Ultima Hora', 'http://www.nacion.com/rss/latest/'), |
| 28 |
('Nacionales', 'http://www.nacion.com/rss/nacional/'), |
| 29 |
('Entretenimiento', 'http://www.nacion.com/rss/ocio/'), |
| 30 |
('Sucesos', 'http://www.nacion.com/rss/sucesos/'), |
| 31 |
('Deportes', 'http://www.nacion.com/rss/deportes/'), |
| 32 |
('Internacionales', 'http://www.nacion.com/rss/mundo/'), |
| 33 |
('Economia', 'http://www.nacion.com/rss/economia/'), |
| 34 |
('Vivir', 'http://www.nacion.com/rss/vivir/'), |
| 35 |
('Tecnologia', 'http://www.nacion.com/rss/tecnologia/'), |
| 36 |
('Opinion', 'http://www.nacion.com/rss/opinion/'), |
| 37 |
] |
| 38 |
|
| 39 |
def get_cover_url(self): |
| 40 |
index = 'http://kiosko.net/cr/np/cr_nacion.html' |
| 41 |
soup = self.index_to_soup(index) |
| 42 |
for image in soup.findAll('img', src=True): |
| 43 |
if image['src'].endswith('cr_nacion.750.jpg'): |
| 44 |
return image['src'] |
| 45 |
return None |
| 46 |
|
| 47 |
def get_article_url(self, article): |
| 48 |
url = article.get('guid', None) |
| 49 |
return url |
| 50 |
|
| 51 |
extra_css = ''' |
| 52 |
h1{font-family:Arial,Helvetica,sans-serif; font-weight:bold;font-size:30px;} |
| 53 |
h2{font-family:Arial,Helvetica,sans-serif; font-weight:normal; font-style:italic; font-size:18px;} |
| 54 |
''' |