#!/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
__license__ = 'GPL v3'
__copyright__ = '2008, Kovid Goyal <kovid at kovidgoyal.net, Armin Geller>'


class Carta(BasicNewsRecipe):
    # Update 2017-09-01
    # Armin Geller

    title = u'Carta'
    description = 'Authors blog for politics, economics and digital community'
    __author__ = 'Armin Geller'  # AGe Update 2017-09-01

    timefmt = ' [%a %d %b %Y]'
    oldest_article = 14
    max_articles_per_feed = 50
    no_stylesheets = True
    remove_javascript = True
    remove_empty_feeds = True
    encoding = 'utf-8'
    language = 'de'

    cover_url = 'http://www.carta.info/wp-content/themes/carta2014/img/carta-logo.svg'  # AGe Update 2014-10-05 new cover
    masthead_url = 'http://upload.wikimedia.org/wikipedia/de/b/ba/Carta_logo.png'
    #    masthead_url   ='http://www.carta.info/wp-content/themes/carta2014/img/carta-logo.svg'
    extra_css = '''
                      h2 {font-size: 1.3em; font-style: italic}
                      .excerpt {font-size: 1.2em; font-style: italic}
                      '''

    keep_only_tags = [
        dict(name='div', attrs={'class': ['article-text', 'author']}),
        dict(name='p', attrs={'class': 'tags'}),
    ]

    remove_tags = [
        dict(name='ul', attrs={'class': 'meta'}),
    ]

    feeds = [
        (u'CARTA - Standard', u'http://feeds2.feedburner.com/carta-standard-rss'),
        (u'CARTA - Homepage', u'http://feeds2.feedburner.com/carta-homepage-rss'),
        (u'CARTA - Agenda', u'http://feeds2.feedburner.com/carta-agenda-rss'),
        (u'CARTA - Ökonomie', u'http://feeds2.feedburner.com/carta-oekonomie-rss'),
        (u'CARTA - Medien', u'http://feeds2.feedburner.com/carta-medien-rss'),
    ]
