# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
import re
from calibre.web.feeds.news import BasicNewsRecipe


class Computerworld_pl(BasicNewsRecipe):
    title = u'Computerworld.pl'
    __author__ = 'fenuks'
    description = u'Serwis o IT w przemyśle, finansach, handlu, administracji oraz rynku IT i telekomunikacyjnym - wiadomości, opinie, analizy, porady prawne'
    category = 'IT'
    language = 'pl'
    masthead_url = 'http://g1.computerworld.pl/cw/beta_gfx/cw2.gif'
    cover_url = 'http://g1.computerworld.pl/cw/beta_gfx/cw2.gif'
    no_stylesheets = True
    oldest_article = 7
    max_articles_per_feed = 100
    use_embedded_content = False
    preprocess_regexps = [(re.compile(u'Zobacz również:', re.IGNORECASE), lambda m: ''),
                          (re.compile(u'[*]+reklama[*]+', re.IGNORECASE), lambda m: ''), ]
    keep_only_tags = [dict(name='article')]
    remove_tags = [dict(attrs={'class': ['share_tools nocontent', 'rec']}),
         dict(name='ul',attrs={'class':'tags'}),
         dict(name='ol'),
         dict(id=['topComment', 'bottom_tools'])]

    feeds = [(u'Wiadomo\u015bci', u'https://www.computerworld.pl/news?rss')]
