# -*- coding: utf-8 -*-
from calibre.web.feeds.news import BasicNewsRecipe


class LV_gl(BasicNewsRecipe):
    title = u'De Luns a Venres (RSS)'
    __author__ = u'Susana Sotelo Docío'
    description = u'O gratuíto galego'
    publisher = u'Galiciaé'
    category = u'news'
    encoding = 'utf-8'
    language = 'gl'
    direction = 'ltr'
    cover_url = 'http://lv.galiciae.com/new_estilos/lv/logo.gif'
    oldest_article = 2
    max_articles_per_feed = 200
    center_navbar = False

    feeds = [
        (u'Galicia', u'http://lv.galiciae.com/cache/rss/sec_galicia_gl.rss'),
        (u'Cultura', u'http://lv.galiciae.com/cache/rss/sec_cultura_gl.rss'),
        (u'Mundo', u'http://lv.galiciae.com/cache/rss/sec_mundo_gl.rss'),
        (u'Cidadanía', u'http://lv.galiciae.com/cache/rss/sec_ciudadania_gl.rss'),
        (u'Tecnoloxía', u'http://lv.galiciae.com/cache/rss/sec_tecnologia_gl.rss'),
        (u'España', u'http://lv.galiciae.com/cache/rss/sec_espana_gl.rss'),
        (u'Deportes', u'http://lv.galiciae.com/cache/rss/sec_deportes_gl.rss'),
        (u'Economía', u'http://lv.galiciae.com/cache/rss/sec_economia_gl.rss'),
        (u'Lercheo', u'http://lv.galiciae.com/cache/rss/sec_gente_gl.rss'),
        (u'Medio ambiente', u'http://lv.galiciae.com/cache/rss/sec_medioambiente_gl.rss'),
        (u'España/Mundo', u'http://lv.galiciae.com/cache/rss/sec_espanamundo_gl.rss'),
        (u'Sociedade', u'http://lv.galiciae.com/cache/rss/sec_sociedad_gl.rss'),
        (u'Ciencia', u'http://lv.galiciae.com/cache/rss/sec_ciencia_gl.rss'),
        (u'Motor', u'http://lv.galiciae.com/cache/rss/sec_motor_gl.rss'),
        (u'Coches', u'http://lv.galiciae.com/cache/rss/sec_coches_gl.rss'),
        (u'Motos', u'http://lv.galiciae.com/cache/rss/sec_motos_gl.rss'),
        (u'Industriais', u'http://lv.galiciae.com/cache/rss/sec_industriales_gl.rss')
    ]

    extra_css = u' p{text-align:left} '
    html2epub_options = 'publisher="' + publisher + '"\ncomments="' + description + '"\nencoding="' + \
        encoding + '"\ntags="' + category + \
        '"\noverride_css=" p {text-align:left; text-indent: 0cm} "'

    def print_version(self, url):
        url += '?imprimir&lang=gl'
        return url
