#!/usr/bin/env python
# vim:fileencoding=utf-8
from calibre.web.feeds.news import BasicNewsRecipe


class news324cat(BasicNewsRecipe):
    title = '324.cat'
    description = (
        '324.cat is the Catalan-language news portal by the public Catalan Corporation of Audiovisual Media (CCMA).'
        ' Its contents are based on reporting material by journalists of TV3 and Catalunya Radio,'
        ' the leading news sources in Catalan language.'
    )
    oldest_article = 2  # days
    max_articles_per_feed = 30  # articles
    auto_cleanup = True
    language = 'ca'
    __author__ = 'santboia'
    encoding = 'utf-8'
    use_embedded_content = False
    no_stylesheets = True
    remove_attributes = ['style', 'height', 'width']
    ignore_duplicate_articles = {'url'}

    feeds = [
        ('Portada', 'https://api.ccma.cat/noticies?_format=rss&origen=frontal&frontal=n324-portada-noticia&version=2.0'),
    ]
