__copyright__ = '2015, Darko Miletic <darko.miletic at gmail.com>'
'''
www.lapoliticaonline.com
'''

from calibre.web.feeds.news import BasicNewsRecipe


class LaPoliticaOnline_AR(BasicNewsRecipe):
    title = 'La Politica Online'
    __author__ = 'Darko Miletic'
    description = 'Informacion actualizada las 24 horas, con noticias de Argentina y del mundo'
    publisher = 'La Politica Online SA'
    category = 'news, politics, Argentina'
    oldest_article = 1
    max_articles_per_feed = 100
    use_embedded_content = False
    auto_cleanup = False
    no_stylesheets = True
    encoding = 'latin1'
    language = 'es_AR'
    publication_type = 'newspaper'
    remove_empty_feeds = True
    masthead_url = 'http://www.lapoliticaonline.com/0/img/header/logo.gif'
    extra_css = '''
                                .title,.vsmcontent{font-family: Georgia,"Times New Roman",Times,serif}
                                body{font-family: Arial,Helvetica,sans-serif}
                                .galleryfooter{font-size: small; color: gainsboro;}
                                img{display: block}
                                .title{font-size: x-large; font-weight: bold; line-height: 2em;}
                            '''

    conversion_options = {'comment': description, 'tags': category, 'publisher': publisher, 'language': language}

    remove_tags = [
        dict(name=['iframe', 'embed', 'object', 'meta', 'link', 'button']),
        dict(attrs={'class': ['share-related', 'controls oneimage', 'toolbar', 'itemheader']}),
    ]

    remove_tags_before = dict(name='div', attrs={'class': 'title'})
    remove_tags_after = dict(attrs={'id': 'vsmcontent'})

    feeds = [
        ('Politica', 'http://www.lapoliticaonline.com/files/rss/politica.xml'),
        ('Economia', 'http://www.lapoliticaonline.com/files/rss/economia.xml'),
        ('Ciudad', 'http://www.lapoliticaonline.com/files/rss/ciudad.xml'),
        ('Provincia', 'http://www.lapoliticaonline.com/files/rss/provincia.xml'),
        ('Conurbano', 'http://www.lapoliticaonline.com/files/rss/conurbano.xml'),
        ('Mendoza', 'http://www.lapoliticaonline.com/files/rss/mendoza.xml'),
        ('Santa Fe', 'http://www.lapoliticaonline.com/files/rss/santafe.xml'),
        ('Transporte', 'http://www.lapoliticaonline.com/files/rss/transporte.xml'),
        ('Energia', 'http://www.lapoliticaonline.com/files/rss/energía.xml'),
        ('Judiciales', 'http://www.lapoliticaonline.com/files/rss/judiciales.xml'),
    ]
