#!/usr/bin/env python
# vim:fileencoding=utf-8
from __future__ import unicode_literals, division, absolute_import, print_function
from calibre.web.feeds.news import BasicNewsRecipe


class OselCZ(BasicNewsRecipe):
    title = 'OSEL.cz'
    __author__ = 'spacekpe'
    oldest_article = 100
    max_articles_per_feed = 100
    auto_cleanup = True
    recursions = 1
    language = 'cs'

    feeds = [
        ('OSEL.cz', 'http://www.osel.cz/rss/rss.php'),
    ]

    def print_version(self, url):
        return url.replace('http://www.osel.cz/index.php?clanek=', 'http://www.osel.cz/tisk.php?clanek=')

    def get_cover_url(self):
        return 'http://www.osel.cz/themes/default/logo_osel.gif'

    def is_link_wanted(self, url, tag):
        if url.startswith('http://www.osel.cz/popisek.php'):
            return True
        else:
            return False
