from calibre.web.feeds.news import BasicNewsRecipe

LANGUAGE = 'de'


def feedlink(num):
    return u'http://europa.eu/rapid/syndication/QuickRSSAction.do?id=' +\
        str(num) + '&lang=' + LANGUAGE


class EUCommissionPress(BasicNewsRecipe):
    title = u'Pressemitteilungen der EU Kommission pro Politikbereich'
    oldest_article = 7
    max_articles_per_feed = 100
    no_stylesheets = True
    cover_url = 'http://ec.europa.eu/wel/template_2007/images/banners/banner-background.jpg'
    __author__ = 'malfi'
    language = LANGUAGE
    keep_only_tags = []
    keep_only_tags.append(
        dict(name='div', attrs={'class': 'pressReleaseContentMain'}))
    remove_tags = []

    feeds = [
        (u'Pressemitteilung des Tages', feedlink(64)),
        (u'Presidency', feedlink(137)),
        (u'Foreign affairs and security policy', feedlink(138)),
        (u'Agriculture and rural development', feedlink(139)),
        (u'Budget and financial programming ', feedlink(140)),
        (u'Climate action', feedlink(141)),
        (u'Competition', feedlink(142)),
        (u'Development', feedlink(143)),
        (u'Digital agenda', feedlink(144)),
        (u'Economic and monetary affairs', feedlink(145)),
        (u'Education, culture, multilingualism and youth ', feedlink(146)),
        (u'Employment, social Affairs and inclusion ', feedlink(147)),
        (u'Energy', feedlink(148)),
        (u'Enlargment and European neighbourhood policy ', feedlink(149)),
        (u'Environment', feedlink(150)),
        (u'Health and consumer policy', feedlink(151)),
        (u'Home affairs', feedlink(152)),
        (u'Industry and entrepreneurship', feedlink(153)),
        (u'Inter-Institutional relations and administration', feedlink(154)),
        (u'Internal market and services', feedlink(155)),
        (u'International cooperation, humanitarian aid and crisis response', feedlink(
            156)),
        (u'Justice, fundamental rights and citizenship', feedlink(157)),
        (u'Maritime affairs and fisheries', feedlink(158)),
        (u'Regional policy', feedlink(159)),
        (u'Research and innovation', feedlink(160)),
        (u'Taxation and customs union, audit and anti-fraud', feedlink(161)),
        (u'Trade', feedlink(162)),
        (u'Transport', feedlink(163))
    ]
    extra_css = '''
     h1{font-family:Arial,Helvetica,sans-serif; font-weight:bold;font-size:large;}
     h2{font-family:Arial,Helvetica,sans-serif; font-weight:normal;font-size:small;}
     p{font-family:Arial,Helvetica,sans-serif;font-size:small;}
     body{font-family:Helvetica,Arial,sans-serif;font-size:small;}
     '''
