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

from calibre.web.feeds.news import BasicNewsRecipe

class RusiaHoy(BasicNewsRecipe):
    title                 = 'Rusia Hoy'
    __author__            = 'Darko Miletic'
    description           = 'Noticias de Russia en castellano'
    publisher             = 'rusiahoy.com'
    category              = 'news, politics, Russia'
    oldest_article        = 7
    max_articles_per_feed = 200
    no_stylesheets        = True
    encoding              = 'utf8'
    use_embedded_content  = False
    language              = 'es'
    remove_empty_feeds    = True
    extra_css             = """
                                body{font-family: Arial,sans-serif }
                                .article_article_title{font-size: xx-large; font-weight: bold}
                                .article_date{color: black; font-size: small}
                            """

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

    remove_tags = [dict(name=['meta','link','iframe','base','object','embed'])]
    keep_only_tags=[  dict(attrs={'class':['article_rubric_title','article_date','article_article_title','article_article_lead']})
                     ,dict(attrs={'class':'article_article_text'})
                   ]
    remove_attributes=['align','width','height']

    feeds = [(u'Articulos', u'http://rusiahoy.com/xml/index.xml')]

    def preprocess_html(self, soup):
        for item in soup.findAll(style=True):
            del item['style']
        return soup

