#!/usr/bin/env python
# -*- coding: utf-8 -*-

__license__ = 'GPL v3'
__copyright__ = '2011, Silviu Cotoar\u0103'
'''
gsp.ro
'''

from calibre.web.feeds.news import BasicNewsRecipe


class GSP(BasicNewsRecipe):
    title = 'Gazeta Sporturilor'
    language = 'ro'
    __author__ = 'Silviu Cotoar\u0103'
    description = 'Gazeta Sporturilor'
    publisher = 'Gazeta Sporturilor'
    category = 'Ziare,Sport,Stiri,Romania'
    oldest_article = 5
    max_articles_per_feed = 100
    no_stylesheets = True
    use_embedded_content = False
    encoding = 'utf-8'
    remove_javascript = True
    cover_url = 'http://www.gsp.ro/images/logo.jpg'

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

    keep_only_tags = [
        dict(name='h1', attrs={'class': 'serif title_2'}),
        dict(name='div', attrs={'id': 'only_text'}),
        dict(name='span', attrs={'class': 'block poza_principala'}),  # noqa: E501
    ]

    feeds = [('\u0218tiri', 'http://www.gsp.ro/rss.xml')]

    def preprocess_html(self, soup):
        return self.adeify_images(soup)
