Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Recipes

Notices

Reply
 
Thread Tools Search this Thread
Old 11-08-2011, 02:10 PM   #1
jansoz
Junior Member
jansoz began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Mar 2011
Device: Sony
Berlingske once more

On May 24, I posted a wish for a recipe, but still no answer. The Danish newspaper Berlingske has got a new name and a new website, http://www.b.dk/. Therefore, the old recipe for Berlingske Tidende on www.berlingske.dk doesn't work correctly. It only downloads the links to the articles, not the content it self.
I would be very glad if this recipe could be updated.
jansoz is offline   Reply With Quote
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
Advert
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Berlingske jansoz Recipes 0 05-24-2011 11:49 AM
Berlingske don't download properly jansoz Recipes 0 03-17-2011 02:31 PM


All times are GMT -4. The time now is 12:10 AM.


MobileRead.com is a privately owned, operated and funded community.