__license__ = 'GPL v3'
__copyright__ = '2010, Darko Miletic <darko.miletic at gmail.com>'
'''
www.larioja.com
'''

from calibre.web.feeds.news import BasicNewsRecipe


class LaRioja(BasicNewsRecipe):
    title = 'La Rioja'
    __author__ = 'Arturo Martinez Nieves'
    description = 'Noticias de La Rioja y el resto del mundo'
    publisher = 'La Rioja'
    category = 'news, politics, Spain'
    oldest_article = 2
    max_articles_per_feed = 200
    no_stylesheets = True
    encoding = 'cp1252'
    use_embedded_content = False
    language = 'es'
    remove_empty_feeds = True
    masthead_url = 'http://www.larioja.com/includes/manuales/larioja/include-lariojapapeldigital-zonac-fondocabecera01.jpg'
    extra_css = ' body{font-family: Arial,Helvetica,sans-serif } img{margin-bottom: 0.4em} .photo-caption{font-size: x-small} '

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

    keep_only_tags = [
        dict(attrs={'id': 'title'}), dict(attrs={'class': [
            'overhead', 'headline', 'subhead', 'date', 'text', 'noticia_cont', 'desarrollo']})
    ]
    remove_tags = [dict(name='ul')]
    remove_attributes = ['width', 'height']

    feeds = [

    (u'Ultimas Noticias', u'http://www.larioja.com/rss/feeds/ultima.xml'),
    (u'Portada', u'http://www.larioja.com/rss/feeds/portada.xml'),
    (u'Mundo', u'http://www.larioja.com/rss/feeds/mundo.xml'),
    (u'Espana', u'http://www.larioja.com/rss/feeds/espana.xml'),
    (u'Region', u'http://www.larioja.com/rss/feeds/region.xml'),
    (u'Comarcas', u'http://www.larioja.com/rss/feeds/comarcas.xml'),
    (u'Deportes', u'http://www.larioja.com/rss/feeds/deportes.xml'),
    (u'Economia', u'http://www.larioja.com/rss/feeds/economia.xml'),
    (u'Cultura', u'http://www.larioja.com/rss/feeds/cultura.xml'),
    (u'Opinion', u'http://www.larioja.com/rss/feeds/opinion.xml'),
    (u'Sociedad', u'http://www.larioja.com/rss/feeds/sociedad.xml')

    ]
