View Single Post
Old 11-08-2011, 08:08 PM   #2
NotTaken
Connoisseur
NotTaken is fluent in JavaScript as well as Klingon.NotTaken is fluent in JavaScript as well as Klingon.NotTaken is fluent in JavaScript as well as Klingon.NotTaken is fluent in JavaScript as well as Klingon.NotTaken is fluent in JavaScript as well as Klingon.NotTaken is fluent in JavaScript as well as Klingon.NotTaken is fluent in JavaScript as well as Klingon.NotTaken is fluent in JavaScript as well as Klingon.NotTaken is fluent in JavaScript as well as Klingon.NotTaken is fluent in JavaScript as well as Klingon.NotTaken is fluent in JavaScript as well as Klingon.
 
Posts: 65
Karma: 4640
Join Date: Aug 2011
Device: kindle
You can find a list of rss feeds at http://www.b.dk/rss. Try following the guide at http://manual.calibre-ebook.com/news.html.

I replaced all instances of berlingske.dk with b.dk and converted the recipe to use autoclean to start you off. I only tested on the first two rss feeds and haven't checked the paths of the rest of the feeds.

Code:
__license__   = 'GPL v3'
__copyright__ = '2010, Darko Miletic <darko.miletic at gmail.com>'
'''
berlingske.dk
'''

from calibre.web.feeds.news import BasicNewsRecipe

class Berlingske_dk(BasicNewsRecipe):
    title                 = 'Berlingske Tidende'
    __author__            = 'Darko Miletic'
    description           = 'News from Denmark'
    publisher             = 'berlingske.dk'
    category              = 'news, politics, Denmark'
    oldest_article        = 2
    max_articles_per_feed = 100
    no_stylesheets        = True
    remove_empty_feeds    = True
    use_embedded_content  = False
    remove_javascript     = True
    publication_type      = 'newspaper'
    encoding              = 'utf8'
    language              = 'da'
    auto_cleanup          = True
    extra_css             = '''
                            .manchet {color:#888888;}
                            .dateline {font-size: x-small; color:#444444;}
                            .manchet,.dateline { font-family: Cambria,Georgia,Times,"Times New Roman",serif }
                            .body {font-family: Arial,Helvetica,sans-serif }
                            '''
    
    conversion_options = {
                          'comment'  : description
                        , 'tags'     : category
                        , 'publisher': publisher
                        , 'language' : language
                        }

    feeds              = [
                            (u'Breaking news' , u'http://www.b.dk/breaking/rss'          )
                           ,(u'Seneste nyt'   , u'http://www.b.dk/seneste/rss'           )
                           ,(u'Topnyheder'    , u'http://www.b.dk/top/rss'               )
                           ,(u'Danmark'       , u'http://www.b.dk/danmark/seneste/rss'   )
                           ,(u'Verden'        , u'http://www.b.dk/verden/seneste/rss'    )
                           ,(u'Klima'         , u'http://www.b.dk/klima/seneste/rss'     )
                           ,(u'Debat'         , u'http://www.b.dk/debat/seneste/rss'     )
                           ,(u'Koebenhavn'    , u'http://www.b.dk/koebenhavn/seneste/rss')
                           ,(u'Politik'       , u'http://www.b.dk/politik/seneste/rss'   )
                           ,(u'Kultur'        , u'http://www.b.dk/kultur/seneste/rss'    )
                          ]

Last edited by NotTaken; 11-08-2011 at 10:33 PM.
NotTaken is offline   Reply With Quote