#!/usr/bin/env python
__license__ = 'GPL v3'
__author__ = 'Jordi Balcells, based on an earlier version by Lorenzo Vigentini & Kovid Goyal'
__copyright__ = '2008, Kovid Goyal kovid@kovidgoyal.net'
description = 'Main daily newspaper from Spain - v1.04 (19, October 2010)'
__docformat__ = 'restructuredtext en'

'''
elpais.es
'''

from calibre.web.feeds.news import BasicNewsRecipe


class ElPais(BasicNewsRecipe):
    __author__ = 'Kovid Goyal & Lorenzo Vigentini & Jordi Balcells'
    description = 'Main daily newspaper from Spain'

    title = u'El Pais'
    publisher = u'Ediciones El Pa\xeds SL'
    category = 'News, politics, culture, economy, general interest'

    language = 'es'
    timefmt = '[%a, %d %b, %Y]'

    oldest_article = 2.1
    max_articles_per_feed = 25

    use_embedded_content = False
    recursion = 5

    remove_javascript = True
    no_stylesheets = True

    keep_only_tags = [
        dict(attrs={'class': [
                              'article_header',
                              'article_body',
                              'a_t',
                              'a_st',
                              'articulo-titulares',
                              'articulo-apertura',
                              'articulo__contenedor'
                             ]}),
        dict(name='div', attrs={'class': 'a_c',}),

    ]

    remove_tags = [
        dict(
            attrs={'class': [
                              'sumario__interior',
                              'articulo-trust',
                              'compartir',
                              'articulo-tags',
                              'outbrain',
                              'more_info',
                              'articulo-apoyos',
                              'top10',
                             ]
                    },
            ),
        dict(id='cta_id'),
        dict(name='svg'),
    ]

    feeds = [
        (u'Espa\xf1a', u'https://feeds.elpais.com/mrss-s/pages/ep/site/elpais.com/section/espana/portada'),
        (u'Internacional',
         u'https://feeds.elpais.com/mrss-s/pages/ep/site/elpais.com/section/internacional/portada'),
        (u'Opini\xf3n', u'https://elpais.com/rss/elpais/opinion.xml'),
        (u'Ciencia', u'https://feeds.elpais.com/mrss-s/pages/ep/site/elpais.com/section/ciencia/portada'),
        (u'Tecnolog\xeda',
         u'https://feeds.elpais.com/mrss-s/pages/ep/site/elpais.com/section/tecnologia/portada'),
        (u'Cultura', u'https://feeds.elpais.com/mrss-s/pages/ep/site/elpais.com/section/cultura/portada'),
        (u'Estilo', u'https://feeds.elpais.com/mrss-s/pages/ep/site/elpais.com/section/estilo/portada'),
        (u'Deportes', u'https://feeds.elpais.com/mrss-s/pages/ep/site/elpais.com/section/deportes/portada'),
        (u'Televisión', u'https://feeds.elpais.com/mrss-s/pages/ep/site/elpais.com/section/television/portada'),
        (u'Sociedad', u'https://feeds.elpais.com/mrss-s/pages/ep/site/elpais.com/section/sociedad/portada'),
        (u'Blogs', u'http://ep01.epimg.net/rss/elpais/blogs.xml'),
    ]
