# -*- coding: utf-8 -*-
from calibre.web.feeds.news import BasicNewsRecipe


class eioba(BasicNewsRecipe):
    title = u'eioba'
    __author__ = 'fenuks'
    description = u'eioba.pl - daj się przeczytać!'
    cover_url = 'http://www.eioba.org/lay/logo_pl_v3.png'
    language = 'pl'
    oldest_article = 7
    remove_empty_feeds = True
    max_articles_per_feed = 100
    extra_css = '#ctl0_body_Topic {font-weight: bold; font-size:30px;}'
    keep_only_tags = [dict(id=['ctl0_body_Topic', 'articleContent'])]
    feeds = [(u'Wszyskie kategorie', u'http://feeds.eioba.pl/eioba-pl-top'),
             (u'Technologia', u'http://www.eioba.pl/feed/categories/1.xml'),
             (u'Nauka', u'http://www.eioba.pl/feed/categories/12.xml'),
             (u'Finanse', u'http://www.eioba.pl/feed/categories/7.xml'),
             (u'Życie', u'http://www.eioba.pl/feed/categories/5.xml'),
             (u'Zainteresowania', u'http://www.eioba.pl/feed/categories/420.xml'),
             (u'Społeczeństwo', u'http://www.eioba.pl/feed/categories/8.xml'),
             (u'Rozrywka', u'http://www.eioba.pl/feed/categories/10.xml'),
             (u'Rożne', u'http://www.eioba.pl/feed/categories/9.xml')
             ]

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