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

from calibre.web.feeds.news import BasicNewsRecipe


class Orsai(BasicNewsRecipe):
    title = 'Orsai'
    __author__ = 'Darko Miletic'
    language = 'es'
    oldest_article = 35
    max_articles_per_feed = 100
    encoding = 'utf-8'
    no_stylesheets = True
    use_embedded_content = False
    publication_type = 'blog'
    masthead_url = 'http://orsai.bitacoras.com/wp-content/themes/orsai/images/logo_orsai.png'

    conversion_options = {
        'comment': 'Blog literario de Hernán Casciari', 'tags': 'blog, Argentina, España, literatura, Casciari',
        'publisher': 'Editorial Orsai S.L.', 'language': 'es'
    }

    keep_only_tags = [dict(
        attrs={'class': ['entry-title', 'entry-meta', 'entry-content', 'commentlist']})]
    remove_tags = [dict(name='img', attrs={'class': 'avatar avatar-40 photo'})]
    feeds = [(u'Articulos', u'http://orsai.bitacoras.com/feed')]

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