__license__ = 'GPL v3'
__author__ = 'Luis Hernandez'
__copyright__ = 'Luis Hernandez<tolyluis@gmail.com>'
__version__ = 'v1.0'
__date__ = '29 January 2011'

'''
http://www.bbc.co.uk/mundo/
'''

from calibre.web.feeds.news import BasicNewsRecipe


class AdvancedUserRecipe1294946868(BasicNewsRecipe):
    title = 'BBC Mundo'
    publisher = 'BBC'

    __author__ = 'Luis Hernandez'
    description = 'BBC World for spanish readers'

    cover_url = 'http://1.bp.blogspot.com/_NHiOjk_uZwU/TEYy7IJAdAI/AAAAAAAABP8/coAE-pJ7_5E/s1600/bbcmundo_h.png'
    oldest_article = 2
    max_articles_per_feed = 100

    remove_javascript = True
    no_stylesheets = True
    use_embedded_content = False

    language = 'es'
    remove_empty_feeds = True
    encoding = 'UTF-8'
    timefmt = '[%a, %d %b, %Y]'

    remove_tags_before = dict(name='div', attrs={'class': ['g-group']})
    remove_tags_after = dict(name='div', attrs={'class': [' g-w8']})

    remove_tags = [
        dict(name='ul', attrs={'class': ['document-tools blq-clearfix', 'blq-clearfix']}),
        dict(
            name='div',
            attrs={
                'class': [
                    'box bx-quote-bubble',
                    'socialmedia-links',
                    'list li-carousel',
                    'list li-plain rolling-news',
                    'list li-plain',
                    'box bx-livestats',
                    'li-tab content',
                    'list li-relatedlinks',
                    'list li-relatedinternetlinks',
                ]
            },
        ),  # noqa: E501
    ]

    feeds = [
        ('Portada', 'http://www.bbc.co.uk/mundo/index.xml'),
        ('Ultimas Noticias', 'http://www.bbc.co.uk/mundo/ultimas_noticias/index.xml'),
        ('Internacional', 'http://www.bbc.co.uk/mundo/temas/internacional/index.xml'),
        ('Economia', 'http://www.bbc.co.uk/mundo/temas/economia/index.xml'),
        ('America Latina', 'http://www.bbc.co.uk/mundo/temas/america_latina/index.xml'),
        ('Ciencia', 'http://www.bbc.co.uk/mundo/temas/ciencia/index.xml'),
        ('Salud', 'http://www.bbc.co.uk/mundo/temas/salud/index.xml'),
        ('Tecnologia', 'http://www.bbc.co.uk/mundo/temas/tecnologia/index.xml'),
        ('Cultura', 'http://www.bbc.co.uk/mundo/temas/cultura/index.xml'),
    ]
