Register Guidelines E-Books Search Today's Posts Mark Forums Read

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


Thread Tools Search this Thread
Old 12-30-2010, 05:45 PM   #1
Junior Member
tfeld began at the beginning.
Posts: 2
Karma: 10
Join Date: Dec 2010
Device: PRS650
Post Recipe for

Find attached the recipe for a german regional news site of the city of Karlsruhe, Germany.

import re

class KANewsRecipe(BasicNewsRecipe):
    title = u''
    description = u'Nachrichten aus Karlsruhe, Deutschland und der Welt.'
    no_stylesheets = True

    oldest_article = 7
    max_articles_per_feed = 100

    feeds = [
                (u'News aus Karlsruhe', ''),
                (u'Kulturnachrichten aus Karlsruhe', ''),
                (u'Durlach: News aus Durlach', ''),
                (u'Stutensee: News aus Stutensee Blankenloch, Büchig, Friedrichstal, Staffort, Spöck', ''),
                (u'Bruchsal: News aus Bruchsal', ''),
                (u'Wirtschaftsnews aus Karlsruhe', ''),
                (u' - Sport', ''),
                (u'KSC-News - News rund um den KSC', ''),
                (u' - BG Karlsruhe', '')

    preprocess_regexps = [
        (re.compile(r'width:[0-9]*?px', re.DOTALL|re.IGNORECASE), lambda match: ''),

    remove_tags_before = dict(id='artdetail_ueberschrift')
    remove_tags_after = dict(id='artdetail_unterzeile')
    remove_tags = [dict(name=['div'], attrs={'class': 'lbx_table'}),
         dict(name=['div'], attrs={'class': 'lk_zumthema'}),
         dict(name=['div'], attrs={'class': 'lk_thumb'}),
         dict(name=['div'], attrs={'class': 'lk_trenner'}),
         dict(name=['div'], attrs={'class': 'lupen_container'}),
         dict(name=['span'], attrs={'style': 'display:none;'}),
         dict(name=['span'], attrs={'class': 'comm_info'}),
         dict(name=['h3'], attrs={'id': 'artdetail_unterzeile'})]

    # removing style attribute _after_ removing specifig tags above
    remove_attributes = ['width','height','style']

    extra_css = '''
         h1{ font-size:large; font-weight:bold;  }
         h2{ font-size:medium; font-weight:bold; }

    def get_cover_url(self):
        return ''
tfeld is offline   Reply With Quote

Tags, recipe

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Custom Daily News Recipe mean_gene Recipes 0 12-27-2010 12:07 PM
Customise News Recipe goaspy Calibre 5 12-08-2010 03:08 PM
Help with news recipe Acey Calibre 2 03-12-2010 06:36 AM
News recipe sorting OzAz Calibre 3 10-30-2009 06:28 PM
The Times news recipe? AprilHare Calibre 1 10-10-2008 01:48 PM

All times are GMT -4. The time now is 12:44 PM. is a privately owned, operated and funded community.