#!/usr/bin/env python2
# 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__ = '2010, Darko Miletic <darko.miletic at gmail.com>'
'''
DR.dk
'''


class DRNyheder(BasicNewsRecipe):
    title                 = 'DR Nyheder'
    __author__            = 'Darko Miletic'
    publisher             = 'DR Nyheder'
    description           = 'Her finder du nyheder fra DR og alle vores TV og Radio kanaler live og on demand - når du har lyst.'
    category              = 'news, politics, money, culture, sport, science, Denmark'
    oldest_article        = 2
    max_articles_per_feed = 50
    no_stylesheets        = True
    encoding              = 'utf8'
    use_embedded_content  = False
    language              = 'da'
    auto_cleanup          = False

    keep_only_tags = [
        dict(name="h1", attrs={'id': 'access-content'}),
        dict(name="p", attrs={'class': 'summary'}),
        dict(name="span", attrs={'itemprop': 'datePublished'}),
        dict(name="div", attrs={'class': 'wcms-article-content'}),
    ]

    remove_tags = [
        dict(name='menu', attrs={'class': 'share'}),
        dict(name='menu', attrs={'class': 'dr-site-share-horizontal'}),
    ]

    # Feed are found here: http://www.dr.dk/nyheder/dr-nyheder-som-rss-feed
    feeds          = [
        ('Indland', 'http://www.dr.dk/nyheder/service/feeds/indland'),
        ('Udland', 'http://www.dr.dk/nyheder/service/feeds/udland'),
        ('Penge', 'http://www.dr.dk/nyheder/service/feeds/penge'),
        ('Politik', 'http://www.dr.dk/nyheder/service/feeds/politik'),
        ('Kultur', 'http://www.dr.dk/nyheder/service/feeds/kultur'),
        ('Sporten', 'http://www.dr.dk/nyheder/service/feeds/sporten'),
        ('Viden', 'http://www.dr.dk/nyheder/service/feeds/viden'),
        ('Lev Nu', 'http://www.dr.dk/nyheder/service/feeds/levnu'),
        ('DR Hovedstadsområdet', 'http://www.dr.dk/Nyheder/Service/feeds/regionale/kbh/'),
        ('DR Bornholm', 'http://www.dr.dk/Nyheder/Service/feeds/regionale/bornholm/'),
        ('DR Syd og Sønderjylland', 'http://www.dr.dk/Nyheder/Service/feeds/regionale/syd/'),
        ('DR Fyn', 'http://www.dr.dk/Nyheder/Service/feeds/regionale/fyn/'),
        ('DR Nordjylland', 'http://www.dr.dk/Nyheder/Service/feeds/regionale/nord/'),
        ('DR Trekantområdet', 'http://www.dr.dk/Nyheder/Service/feeds/regionale/trekanten/'),
        ('DR Sjælland', 'http://www.dr.dk/Nyheder/Service/feeds/regionale/sjaelland/'),
        ('DR Østjylland', 'http://www.dr.dk/Nyheder/Service/feeds/regionale/oestjylland/'),
    ]

