#!/usr/bin/env  python2

'''
www.presseurop.eu/pl
'''

__license__ = 'GPL v3'
__author__ = 'teepel <teepel44@gmail.com>'

from calibre.web.feeds.news import BasicNewsRecipe
import re


class presseurop(BasicNewsRecipe):
    title = u'Presseurop'
    description = u'Najlepsze artykuły z prasy europejskiej'
    language = 'pl'
    oldest_article = 7
    max_articles_per_feed = 100
    auto_cleanup = True
    remove_empty_feeds = True

    feeds = [
        (u'Polityka', u'http://www.presseurop.eu/pl/taxonomy/term/1/%2A/feed'),
        (u'Społeczeństwo', u'http://www.presseurop.eu/pl/taxonomy/term/2/%2A/feed'),
        (u'Gospodarka', u'http://www.presseurop.eu/pl/taxonomy/term/3/%2A/feed'),
        (u'Kultura i debaty', u'http://www.presseurop.eu/pl/taxonomy/term/4/%2A/feed'),
        (u'UE i Świat', u'http://www.presseurop.eu/pl/taxonomy/term/5/%2A/feed')
    ]

    preprocess_regexps = [
        (re.compile(r'\|.*</title>', re.DOTALL | re.IGNORECASE),
         lambda match: '</title>'),
    ]
