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

__license__   = 'GPL v3'
__copyright__ = u'2011, Silviu Cotoar\u0103'
'''
gandul.info
'''

from calibre.web.feeds.news import BasicNewsRecipe

class Gandul(BasicNewsRecipe):
    title                 = u'G\u00E2ndul'
    __author__            = u'Silviu Cotoar\u0103'
    publisher             = 'Gandul'
    description           = 'Cotidian Online'
    oldest_article        = 5
    language              = 'ro'
    max_articles_per_feed = 100
    no_stylesheets        = True
    use_embedded_content  = False
    category              = 'Ziare,Stiri,Romania'
    encoding              = 'utf-8'
    cover_url         = 'http://storage0.dms.mpinteractiv.ro/media/1/1/1706/1064063/1/logo.jpg?width=400'

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

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

    remove_tags = [
             dict(name='a', attrs={'class':'photo'})
           , dict(name='div', attrs={'class':'ad'})
                  ]

    feeds  = [
        (u'\u0218tiri', u'http://www.gandul.info/rss-stiri-prima-pagina.xml')
         ]

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