from calibre.web.feeds.recipes import BasicNewsRecipe


class AdvancedUserRecipe1303841067(BasicNewsRecipe):

    title = u'Pro Physik'
    __author__ = 'schuster, Armin Geller'  # AGE Upd. 2012-11-28, # AGe Upd 2019-02-09
    oldest_article = 4
    max_articles_per_feed = 100

    no_stylesheets = True
    remove_javascript = True
    remove_empty_feeds = True
    language = 'de'

    extra_css = '''
        h1 {font-size: 1.6em; text-align: left}
        h2, h3 {font-size: 1.3em;text-align: left}
        h2.subtitle {font-size: 1.2em;text-align: left;font-style: italic}
        h4, h5, h6 {font-size: 1em;text-align: left}
        .flex-caption {font-size: .75em; font-weight: normal;margin-bottom: .75em}
        .slides {list-style-type: none}
    '''
    # .slides: get rid of <ul><li> list dot in front of pictures

    keep_only_tags = [
        dict(name='div', attrs={'class': ['news-item view-mode-default']})
    ]

    remove_tags = [
        #   dict(name='div', attrs={'class':["withMargin socialWrapper addthis_toolbox addthis_default_style"]}),
        #   dict(name='div', attrs={'class':["insideBox"]}),
    ]

    feeds = [
        (u'Nachrichten',
         u'https://www.pro-physik.de/rss/news.xml'),  # AGe 2019-02-09
        (u'Veranstaltungen',
         u'https://www.pro-physik.de/rss/events.xml'),  # AGe 2019-02-09
    ]
