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

__license__   = 'GPL v3'
__copyright__ = u'2011, Silviu Cotoar\u0103'
'''
financiarul.com
'''

from calibre.web.feeds.news import BasicNewsRecipe

class Financiarul(BasicNewsRecipe):
    title                 = u'Financiarul'
    __author__            = u'Silviu Cotoar\u0103'
    description           = u'FIN.ro'
    publisher             = u'Financiarul'
    oldest_article        = 25
    language              = 'ro'
    max_articles_per_feed = 100
    no_stylesheets        = True
    use_embedded_content  = False
    category              = 'Ziare,Stiri'
    encoding              = 'utf-8'
    cover_url             = 'http://www.financiarul.com/templates/default/images/logo.png'

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

    keep_only_tags = [
                        dict(name='div', attrs={'class':'col2ContentLeftL'})
                     ]

    remove_tags = [
                    dict(name='div',attrs={'class':['infoArticol']})
                  , dict(name='ul', attrs={'class':'navSectiuni'})
                  , dict(name='div', attrs={'class':'separator separatorTop'})
                  , dict(name='div', attrs={'class':'infoArticol infoArticolBottom'})
                  , dict(name='ul', attrs={'class':['related']})
                  , dict(name='div', attrs={'class':['slot panel300 panelGri300 panelGri300s panelGri300sm']})
                  ]

    remove_tags_after = [
                            dict(name='ul', attrs={'class':['related']})
                        ]

    feeds          = [
                        (u'Feeds', u'http://www.financiarul.com/rss')
                     ]

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