# encoding: utf-8 -*-

__license__ = 'GPL v3'
__author__ = 'Josemi Liébana <office at josemi-liebana.com>'
__copyright__ = 'Josemi Liébana'
__version__ = 'v0.1'
__date__ = '5 January 2012'


'''
www.ideal.es
'''

from calibre.web.feeds.news import BasicNewsRecipe


class Ideal(BasicNewsRecipe):
    title = u'Ideal (Edición Granada)'
    __author__ = u'Josemi Liébana'
    description = u'Noticias de Granada y el resto del mundo'
    publisher = 'Ideal'
    category = 'News, Politics, Spain, Granada'
    publication_type = 'Newspaper'
    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.ideal.es/img/rd.logotipo2_ideal.gif'
    cover_url = 'http://www.ideal.es/granada/noticias/201112/24/Media/Granada/portada--647x894.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'Última Hora', u'http://www.ideal.es/granada/rss/feeds/ultima.xml'),
    (u'Portada', u'http://www.ideal.es/granada/portada.xml'),
    (u'Local', u'http://www.ideal.es/granada/rss/feeds/granada.xml'),
    (u'Deportes', u'http://www.ideal.es/granada/rss/feeds/deportes.xml'),
    (u'Sociedad', u'http://www.ideal.es/granada/rss/feeds/sociedad.xml'),
    (u'Cultura', u'http://www.ideal.es/granada/rss/feeds/cultura.xml'),
    (u'Economía', u'http://www.ideal.es/granada/rss/feeds/economia.xml'),
    (u'Costa', u'http://www.ideal.es/granada/rss/feeds/costa.xml'),
    (u'La Carrera', u'http://www.ideal.es/granada/rss/feeds/la_carrera.xml'),
    (u'Puerta Real', u'http://www.ideal.es/granada/rss/feeds/puerta_real.xml'),
    (u'Andalucía', u'http://www.ideal.es/granada/rss/feeds/andalucia.xml'),
    (u'España', u'http://www.ideal.es/granada/rss/feeds/espana.xml'),
    (u'Mundo', u'http://www.ideal.es/granada/rss/feeds/internacional.xml'),
    (u'Vivir', u'http://www.ideal.es/granada/rss/feeds/vivir.xml'),
    (u'Opinión', u'http://www.ideal.es/granada/rss/feeds/opinion.xml'),
    (u'Televisión', u'http://www.ideal.es/granada/rss/feeds/television.xml'),
    (u'Contraportada', u'http://www.ideal.es/granada/rss/feeds/contraportada.xml')
    ]
