#!/usr/bin/env  python

__license__   = 'GPL v3'
__copyright__ = '2009, Darko Miletic <darko.miletic at gmail.com>'
'''
svd.se
'''
from calibre.web.feeds.news import BasicNewsRecipe

class SVD_se(BasicNewsRecipe):
    title                 = 'Svenska Dagbladet'
    __author__            = 'Darko Miletic'
    description           = 'News from Sweden'
    publisher             = 'Svenska Dagbladet'
    category              = 'news, politics, Sveden'
    oldest_article        = 2
    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
                        }

    feeds = [
               (u'Toppnyheter' , u'http://www.svd.se/?service=rss'                   )
              ,(u'Inrikes'     , u'http://www.svd.se/nyheter/inrikes/?service=rss'   )
              ,(u'Utrikes'     , u'http://www.svd.se/nyheter/utrikes/?service=rss'   )
              ,(u'Politik'     , u'http://www.svd.se/nyheter/politik/?service=rss'   )
              ,(u'Idagsidan '  , u'http://www.svd.se/nyheter/idagsidan/?service=rss' )
              ,(u'Vetenskap'   , u'http://www.svd.se/nyheter/vetenskap/?service=rss' )
              ,(u'Sport'       , u'http://www.svd.se/sportspel/nyheter/?service=rss' )
              ,(u'Opinion'     , u'http://www.svd.se/opinion/startsidan/?service=rss')
              ,(u'Kultur'      , u'http://www.svd.se/kulturnoje/nyheter/?service=rss')
            ]

    keep_only_tags = [dict(name='div', attrs={'id':['article-content', 'articlecontent']})]
    remove_tags_after = dict(name='div',attrs={'class':'articlebody'})
    remove_tags = [
                     dict(name=['object','link','base'])
                    ,dict(name='div',attrs={'class':['articlead','factcolumn', 'article-ad']})
                    ,dict(name='ul', attrs={'class':'toolbar articletop clearfix'})
                    ,dict(name='p', attrs={'class':'more'})
                  ]

    
    
