#!/usr/bin/env  python2
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
__license__ = 'GPL v3'
__copyright__ = 'Ruben Pollan <meskio@sindominio.net>'
__docformat__ = 'restructuredtext en'

from calibre.web.feeds.news import BasicNewsRecipe


class AdvancedUserRecipe1335657507(BasicNewsRecipe):
    title = u'diagonal'
    __author__ = 'Ruben Pollan'
    description = 'Periodico quincenal de actualidad critica'
    language = 'es'

    oldest_article = 15
    max_articles_per_feed = 100
    auto_cleanup = True
    cover_url = u'http://diagonalperiodico.net/IMG/siteon0.jpg'

    feeds = [(u'Panorama', u'http://diagonalperiodico.net/-Panorama-.html?page=backend'),
             (u'Global', u'http://diagonalperiodico.net/-Global,104-.html?page=backend'),
             (u'Fotonoticia - Galería',
              u'http://diagonalperiodico.net/-Fotonoticia-Galeria-.html?page=backend'),
             (u'Libertades y Derechos',
              u'http://diagonalperiodico.net/-Libertades-y-Derechos,77-.html?page=backend'),
             (u'Saberes', u'http://diagonalperiodico.net/-Saberes,78-.html?page=backend'),
             (u'En movimiento',
              u'http://diagonalperiodico.net/-En-movimiento-.html?page=backend'),
             (u'Culturas', u'http://diagonalperiodico.net/-Culturas,89-.html?page=backend'),
             (u'Cuerpo', u'http://diagonalperiodico.net/-Cuerpo,99-.html?page=backend'),
             (u'La plaza', u'http://diagonalperiodico.net/-La-plaza-.html?page=backend'),
             (u'Enfoques', u'http://diagonalperiodico.net/-Enfoques,106-.html?page=backend'),
             (u'Humor - Galería',
              u'http://diagonalperiodico.net/-Humor-Galeria-.html?page=backend'),
             (u'Entrevistas digitales',
              u'http://diagonalperiodico.net/-Entrevistas-Digitales-.html?page=backend'),
             (u'Cartas a diagonal',
              u'http://diagonalperiodico.net/-Cartas-a-Diagonal-.html?page=backend'),
             (u'Blogs', u'http://diagonalperiodico.net/-Blogs-.html?page=backend')]

    def get_article_url(self, article):
        link = article.get('link')
        return 'http://diagonalperiodico.net/' + link
