mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-06-23 15:30:45 -04:00
70 lines
2.4 KiB
Python
70 lines
2.4 KiB
Python
#!/usr/bin/env python
|
|
# -*- mode: python -*-
|
|
# -*- coding: utf-8 -*-
|
|
|
|
__license__ = 'GPL v3'
|
|
__copyright__ = '2008-2021, Darko Miletic <darko.miletic at gmail.com>'
|
|
'''
|
|
ambito.com
|
|
'''
|
|
|
|
from calibre.web.feeds.news import BasicNewsRecipe, classes
|
|
|
|
|
|
class Ambito(BasicNewsRecipe):
|
|
title = 'Ambito.com'
|
|
__author__ = 'Darko Miletic'
|
|
description = 'Ambito.com con noticias del Diario Ambito Financiero de Buenos Aires'
|
|
publisher = 'Editorial Nefir S.A.'
|
|
category = 'news, politics, economy, finances, Argentina'
|
|
oldest_article = 1.2
|
|
no_stylesheets = True
|
|
encoding = 'utf-8'
|
|
use_embedded_content = False
|
|
remove_empty_feeds = True
|
|
compress_news_images = True
|
|
scale_news_images_to_device = True
|
|
ignore_duplicate_articles = {'url'}
|
|
language = 'es_AR'
|
|
publication_type = 'newsportal'
|
|
masthead_url = 'https://www.ambito.com/css-custom/239/images/logo-239-2020v2.svg'
|
|
extra_css = '''
|
|
body{font-family: Roboto, sans-serif}
|
|
'''
|
|
|
|
conversion_options = {
|
|
'comment': description,
|
|
'tags': category,
|
|
'publisher': publisher,
|
|
'language': language
|
|
}
|
|
|
|
keep_only_tags = [
|
|
classes(
|
|
'detail-highlighted-multimedia news-headline__publication-date news-headline__title'
|
|
' news-headline__author-wrapper news-headline__article-summary'
|
|
),
|
|
dict(name='article', attrs={'class': lambda x: x and 'article-body' in x.split()}),
|
|
]
|
|
remove_tags = [
|
|
dict(name=['object', 'link', 'embed', 'iframe', 'meta', 'link'])
|
|
]
|
|
|
|
feeds = [
|
|
(u'Portada', u'https://www.ambito.com/rss/home.xml'),
|
|
(u'Economia', u'https://www.ambito.com/rss/economia.xml'),
|
|
(u'Finanzas', u'https://www.ambito.com/rss/finanzas.xml'),
|
|
(u'Politica', u'https://www.ambito.com/rss/politica.xml'),
|
|
(u'Opinion', u'https://www.ambito.com/rss/opinion.xml'),
|
|
(u'Informacion General', u'https://www.ambito.com/rss/informacion-general.xml'),
|
|
(u'Mundo', u'https://www.ambito.com/rss/mundo.xml'),
|
|
(u'Deportes', u'https://www.ambito.com/rss/deportes.xml'),
|
|
(u'Espectaculos', u'https://www.ambito.com/rss/espectaculos.xml'),
|
|
(u'Nacional', u'https://www.ambito.com/rss/nacional.xml')
|
|
]
|
|
|
|
def preprocess_html(self, soup):
|
|
for img in soup.findAll('img', attrs={'data-td-src-property':True}):
|
|
img['src'] = img['data-td-src-property']
|
|
return soup
|