from calibre.web.feeds.news import BasicNewsRecipe


class Arbetaren_SE(BasicNewsRecipe):
    title = u'Arbetaren'
    __author__ = 'Joakim Lindskog'
    description = 'Nyheter fr\xc3\xa5n Arbetaren'
    publisher = 'Arbetaren'
    category = 'news, politics, socialism, Sweden'
    oldest_article = 7
    delay = 1
    max_articles_per_feed = 100
    no_stylesheets = True
    use_embedded_content = False
    encoding = 'utf-8'
    language = 'sv'

    conversion_options = {
        'comment': description, 'tags': category, 'publisher': publisher, 'language': language
    }

    keep_only_tags = [dict(name='div', attrs={'id': 'article'})]
    remove_tags_before = dict(name='div', attrs={'id': 'article'})
    remove_tags_after = dict(name='p', attrs={'id': 'byline'})
    remove_tags = [
        dict(name=['object', 'link', 'base']),
        dict(name='p', attrs={'class': 'print'}),
        dict(name='a', attrs={'class': 'addthis_button_compact'}),
        dict(name='script')
    ]

    feeds = [(u'Nyheter', u'http://www.arbetaren.se/rss/arbetaren.rss?rev=123')]
