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

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

Notices

Reply
 
Thread Tools Search this Thread
Old 05-26-2011, 03:18 PM   #1
schuster
Zealot
schuster doesn't litterschuster doesn't litter
 
Posts: 116
Karma: 100
Join Date: Jan 2011
Location: Germany / NRW /Köln
Device: prs-650 / prs-350 /kindle 3
recipe for Aachener Nachrichten - german

Code:
import string, re
from calibre import strftime
from calibre.web.feeds.recipes import BasicNewsRecipe
from calibre.ebooks.BeautifulSoup import BeautifulSoup
class AdvancedUserRecipe(BasicNewsRecipe):

    title          = u'Aachener Nachrichten'
    __author__  = 'schuster'
    oldest_article = 1
    max_articles_per_feed = 100
    use_embedded_content   = False
    language               = 'de'
    remove_javascript      = True
    cover_url = 'http://www.an-online.de/einwaage/images/an_logo.png'
    masthead_url = 'http://www.an-online.de/einwaage/images/an_logo.png'   
    extra_css = '''
	.fliesstext_detail:{margin-bottom:10%;}
	.headline_1:{margin-bottom:25%;}
                    b{font-family:Arial,Helvetica,sans-serif; font-weight:200;font-size:large;}
                    a{font-family:Arial,Helvetica,sans-serif; font-weight:400;font-size:large;}
                    ll{font-family:Arial,Helvetica,sans-serif; font-weight:100;font-size:large;}
                    h4{font-family:Arial,Helvetica,sans-serif; font-weight:normal;font-size:small;}
                    img {min-width:300px; max-width:600px; min-height:300px; max-height:800px}
                    dd{font-family:Arial,Helvetica,sans-serif;font-size:large;}
                    body{font-family:Helvetica,Arial,sans-serif;font-size:small;}
	'''

             

    keep_only_tags    = [
                       dict(name='span', attrs={'class':['fliesstext_detail', 'headline_1', 'autor_detail']}),
                       dict(id=['header-logo'])                      
  ]

    feeds          = [(u'Euregio', u'http://www.an-online.de/an/rss/Euregio.xml'),
                          (u'Aachen', u'http://www.an-online.de/an/rss/Aachen.xml'),
                          (u'Nordkreis', u'http://www.an-online.de/an/rss/Nordkreis.xml'),
                          (u'Düren', u'http://www.an-online.de/an/rss/Dueren.xml'),
                          (u'Eiffel', u'http://www.an-online.de/an/rss/Eifel.xml'),
                          (u'Eschweiler', u'http://www.an-online.de/an/rss/Eschweiler.xml'),
                          (u'Geilenkirchen', u'http://www.an-online.de/an/rss/Geilenkirchen.xml'),
                          (u'Heinsberg', u'http://www.an-online.de/an/rss/Heinsberg.xml'),
                          (u'Jülich', u'http://www.an-online.de/an/rss/Juelich.xml'),
                          (u'Stolberg', u'http://www.an-online.de/an/rss/Stolberg.xml'),
                          (u'Ratgebenr', u'http://www.an-online.de/an/rss/Ratgeber.xml')]
schuster is offline   Reply With Quote
Old 11-28-2012, 04:49 AM   #2
Divingduck
Fanatic
Divingduck never is beset by a damp, drizzly November in his or her soul.Divingduck never is beset by a damp, drizzly November in his or her soul.Divingduck never is beset by a damp, drizzly November in his or her soul.Divingduck never is beset by a damp, drizzly November in his or her soul.Divingduck never is beset by a damp, drizzly November in his or her soul.Divingduck never is beset by a damp, drizzly November in his or her soul.Divingduck never is beset by a damp, drizzly November in his or her soul.Divingduck never is beset by a damp, drizzly November in his or her soul.Divingduck never is beset by a damp, drizzly November in his or her soul.Divingduck never is beset by a damp, drizzly November in his or her soul.Divingduck never is beset by a damp, drizzly November in his or her soul.
 
Posts: 559
Karma: 59934
Join Date: Nov 2010
Location: Germany
Device: Sony PRS-650
I made an update for this recipe. The new recipe includes all feeds. Feel free to use it or modify it for your needs.

Spoiler:
Code:
from calibre.web.feeds.recipes import BasicNewsRecipe
class AdvancedUserRecipe(BasicNewsRecipe):

    title          = u'Aachener Nachrichten'
    __author__  = 'schuster' #AGE update 2012-11-28
    oldest_article        = 1
    max_articles_per_feed = 100
    no_stylesheets        = True
    remove_javascript     = True
    remove_empty_feeds    = True
    language              = 'de_DE'     

#    cover_url     = 'http://www.aachener-nachrichten.de/img/logos/an_website_retina.png'
    masthead_url  = 'http://www.aachener-nachrichten.de/img/logos/an_website_retina.png'

    keep_only_tags    = [
                          dict(name='article', attrs={'class':['single']})
                        ]
                        
    remove_tags = [
                    dict(name='div', attrs={'class':["clearfix navi-wrapper"]}),
                    dict(name='div', attrs={'id':["article_actions"]}),
                    dict(name='style', attrs={'type':["text/css"]}),
                    dict(name='aside'),
                    dict(name='a', attrs={'class':["btn btn-action"]})
                  ]

    feeds = [
              (u'Lokales - Euregio', u'http://www.aachener-nachrichten.de/cmlink/euregio-rss-1.357285'),
              (u'Lokales - Aachen', u'http://www.aachener-nachrichten.de/cmlink/aachen-rss-1.357286'),
              (u'Lokales - Nordkreis', u'http://www.aachener-nachrichten.de/cmlink/nordkreis-rss-1.358150'),
              (u'Lokales - Düren', u'http://www.aachener-nachrichten.de/cmlink/dueren-rss-1.358626'),
              (u'Lokales - Eiffel', u'http://www.aachener-nachrichten.de/cmlink/eifel-rss-1.358978'),
              (u'Lokales - Eschweiler', u'http://www.aachener-nachrichten.de/cmlink/eschweiler-rss-1.359332'),
              (u'Lokales - Geilenkirchen', u'http://www.aachener-nachrichten.de/cmlink/geilenkirchen-rss-1.359643'),
              (u'Lokales - Heinsberg', u'http://www.aachener-nachrichten.de/cmlink/heinsberg-rss-1.359724'),
              (u'Lokales - Jülich', u'http://www.aachener-nachrichten.de/cmlink/juelich-rss-1.359725'),
              (u'Lokales - Stolberg', u'http://www.aachener-nachrichten.de/cmlink/stolberg-rss-1.359726'),
              (u'News - Politik', u'http://www.aachener-nachrichten.de/cmlink/politik-rss-1.359727'),
              (u'News - Aus aller Welt', u'http://www.aachener-nachrichten.de/cmlink/ausallerwelt-rss-1.453282'),
              (u'News - Wirtschaft', u'http://www.aachener-nachrichten.de/cmlink/wirtschaft-rss-1.359872'),
              (u'News - Kultur', u'http://www.aachener-nachrichten.de/cmlink/kultur-rss-1.365018'),
              (u'News - Kino', u'http://www.aachener-nachrichten.de/cmlink/kino-rss-1.365019'),
              (u'News - Digital', u'http://www.aachener-nachrichten.de/cmlink/digital-rss-1.365020'),
              (u'News - Wissenschaft', u'http://www.aachener-nachrichten.de/cmlink/wissenschaft-rss-1.365021'),
              (u'News - Hochschule', u'http://www.aachener-nachrichten.de/cmlink/hochschule-rss-1.365022'),
              (u'News - Auto', u'http://www.aachener-nachrichten.de/cmlink/auto-rss-1.365023'),
              (u'News - Kurioses', u'http://www.aachener-nachrichten.de/cmlink/kurioses-rss-1.365067'),
              (u'News - Musik', u'http://www.aachener-nachrichten.de/cmlink/musik-rss-1.365305'),
              (u'News - Tagesthema', u'http://www.aachener-nachrichten.de/cmlink/tagesthema-rss-1.365519'),
              (u'News - Newsticker', u'http://www.aachener-nachrichten.de/cmlink/newsticker-rss-1.451948'),
              (u'Sport - Aktuell', u'http://www.aachener-nachrichten.de/cmlink/aktuell-rss-1.366716'),
              (u'Sport - Fußball', u'http://www.aachener-nachrichten.de/cmlink/fussball-rss-1.367060'),
              (u'Sport - Bundesliga', u'http://www.aachener-nachrichten.de/cmlink/bundesliga-rss-1.453367'),
              (u'Sport - Alemannia Aachen', u'http://www.aachener-nachrichten.de/cmlink/alemanniaaachen-rss-1.366057'),
              (u'Sport - Volleyball', u'http://www.aachener-nachrichten.de/cmlink/volleyball-rss-1.453370'),
              (u'Sport - Chio', u'http://www.aachener-nachrichten.de/cmlink/chio-rss-1.453371'),
              (u'Dossier - Kinderuni', u'http://www.aachener-nachrichten.de/cmlink/kinderuni-rss-1.453375'),
              (u'Dossier - Karlspreis', u'http://www.aachener-nachrichten.de/cmlink/karlspreis-rss-1.453376'),
              (u'Dossier - Ritterorden', u'http://www.aachener-nachrichten.de/cmlink/ritterorden-rss-1.453377'),
              (u'Dossier - ZAB-Aachen', u'http://www.aachener-nachrichten.de/cmlink/zabaachen-rss-1.453380'),
              (u'Dossier - Karneval', u'http://www.aachener-nachrichten.de/cmlink/karneval-rss-1.453384'),
              (u'Ratgeber - Geld', u'http://www.aachener-nachrichten.de/cmlink/geld-rss-1.453385'),
              (u'Ratgeber - Recht', u'http://www.aachener-nachrichten.de/cmlink/recht-rss-1.453386'),
              (u'Ratgeber - Gesundheit', u'http://www.aachener-nachrichten.de/cmlink/gesundheit-rss-1.453387'),
              (u'Ratgeber - Familie', u'http://www.aachener-nachrichten.de/cmlink/familie-rss-1.453388'),
              (u'Ratgeber - Livestyle', u'http://www.aachener-nachrichten.de/cmlink/lifestyle-rss-1.453389'),
              (u'Ratgeber - Reisen', u'http://www.aachener-nachrichten.de/cmlink/reisen-rss-1.453390'),
              (u'Ratgeber - Bauen und Wohnen', u'http://www.aachener-nachrichten.de/cmlink/bauen-rss-1.453398'),
              (u'Ratgeber - Bildung und Beruf', u'http://www.aachener-nachrichten.de/cmlink/bildung-rss-1.453400'),
            ]
Attached Files
File Type: zip aachener_nachrichten_AGe2012-11-28.zip (1.3 KB, 42 views)
Divingduck is offline   Reply With Quote
Old 11-30-2012, 02:49 AM   #3
dkosse
Member
dkosse began at the beginning.
 
Posts: 10
Karma: 10
Join Date: Nov 2012
Device: Sony PRS-T1, PocketBook 902
Hi,

thank you very much but an additional question

Yesterday with Sony t1 connected, no problem.

Today with Pocketbook pro 902 connectet an error message, details you´ll find below.

calibre, version 0.9.8 (win32, isfrozen: True)
Konvertierungsfehler: Fehlgeschlagen: Nachrichten abrufen von Aachener Nachrichten

Nachrichten abrufen von Aachener Nachrichten
Resolved conversion options
calibre version: 0.9.8
{'asciiize': False,
'author_sort': None,
'authors': None,
'base_font_size': 0,
'book_producer': None,
'change_justification': 'original',
'chapter': None,
'chapter_mark': 'pagebreak',
'comments': None,
'cover': None,
'debug_pipeline': None,
'dehyphenate': True,
'delete_blank_paragraphs': True,
'disable_font_rescaling': False,
'dont_download_recipe': False,
'dont_split_on_page_breaks': True,
'duplicate_links_in_toc': False,
'embed_font_family': None,
'enable_heuristics': False,
'epub_flatten': False,
'extra_css': None,
'extract_to': None,
'filter_css': None,
'fix_indents': True,
'flow_size': 260,
'font_size_mapping': None,
'format_scene_breaks': True,
'html_unwrap_factor': 0.4,
'input_encoding': None,
'input_profile': <calibre.customize.profiles.InputProfile object at 0x02B70370>,
'insert_blank_line': False,
'insert_blank_line_size': 0.5,
'insert_metadata': False,
'isbn': None,
'italicize_common_cases': True,
'keep_ligatures': False,
'language': None,
'level1_toc': None,
'level2_toc': None,
'level3_toc': None,
'line_height': 0,
'linearize_tables': False,
'lrf': False,
'margin_bottom': 5.0,
'margin_left': 5.0,
'margin_right': 5.0,
'margin_top': 5.0,
'markup_chapter_headings': True,
'max_toc_links': 50,
'minimum_line_height': 120.0,
'no_chapters_in_toc': False,
'no_default_epub_cover': False,
'no_inline_navbars': False,
'no_svg_cover': False,
'output_profile': <calibre.customize.profiles.SonyReaderOutput object at 0x02B70830>,
'page_breaks_before': None,
'prefer_metadata_cover': False,
'preserve_cover_aspect_ratio': False,
'pretty_print': True,
'pubdate': None,
'publisher': None,
'rating': None,
'read_metadata_from_opf': None,
'remove_fake_margins': True,
'remove_first_image': False,
'remove_paragraph_spacing': False,
'remove_paragraph_spacing_indent_size': 1.5,
'renumber_headings': True,
'replace_scene_breaks': '',
'search_replace': None,
'series': None,
'series_index': None,
'smarten_punctuation': False,
'sr1_replace': '',
'sr1_search': '',
'sr2_replace': '',
'sr2_search': '',
'sr3_replace': '',
'sr3_search': '',
'start_reading_at': None,
'subset_embedded_fonts': False,
'tags': None,
'test': False,
'timestamp': None,
'title': None,
'title_sort': None,
'toc_filter': None,
'toc_threshold': 6,
'unsmarten_punctuation': False,
'unwrap_lines': True,
'use_auto_toc': False,
'verbose': 2}
InputFormatPlugin: Recipe Input running
Using custom recipe
Python function terminated unexpectedly
(Error Code: 1)
Traceback (most recent call last):
File "site.py", line 132, in main
File "site.py", line 109, in run_entry_point
File "site-packages\calibre\utils\ipc\worker.py", line 186, in main
File "site-packages\calibre\gui2\convert\gui_conversion.py", line 25, in gui_convert
File "site-packages\calibre\ebooks\conversion\plumber.py", line 1009, in run
File "site-packages\calibre\customize\conversion.py", line 239, in __call__
File "site-packages\calibre\ebooks\conversion\plugins\recipe_ input.py", line 109, in convert
File "site-packages\calibre\web\feeds\news.py", line 891, in download
File "site-packages\calibre\web\feeds\news.py", line 1063, in build_index
File "site-packages\calibre\web\feeds\news.py", line 1480, in parse_feeds
File "site-packages\calibre\web\feeds\news.py", line 381, in get_feeds
NotImplementedError


Best regards

dkosse
dkosse is offline   Reply With Quote
Old 11-30-2012, 03:52 AM   #4
Divingduck
Fanatic
Divingduck never is beset by a damp, drizzly November in his or her soul.Divingduck never is beset by a damp, drizzly November in his or her soul.Divingduck never is beset by a damp, drizzly November in his or her soul.Divingduck never is beset by a damp, drizzly November in his or her soul.Divingduck never is beset by a damp, drizzly November in his or her soul.Divingduck never is beset by a damp, drizzly November in his or her soul.Divingduck never is beset by a damp, drizzly November in his or her soul.Divingduck never is beset by a damp, drizzly November in his or her soul.Divingduck never is beset by a damp, drizzly November in his or her soul.Divingduck never is beset by a damp, drizzly November in his or her soul.Divingduck never is beset by a damp, drizzly November in his or her soul.
 
Posts: 559
Karma: 59934
Join Date: Nov 2010
Location: Germany
Device: Sony PRS-650
Just check the recipe with Calibre 0.9.8. Can't see any problems with the recipe.
Best regards, DD
Divingduck is offline   Reply With Quote
Old 11-30-2012, 09:37 AM   #5
dkosse
Member
dkosse began at the beginning.
 
Posts: 10
Karma: 10
Join Date: Nov 2012
Device: Sony PRS-T1, PocketBook 902
Hi DD,

after updateing to 0.9.8 everything is going well, thank you very much

dkosse
dkosse is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Gute Nachrichten für die Besitzer von 302 Geräten review PocketBook 22 03-21-2011 02:19 PM
Nachrichten per Calibre aufs Pocketbook Sturgis PocketBook 57 01-04-2010 03:24 AM
Eigene Nachrichten richtig kategorisieren ganymede PocketBook 2 12-15-2009 08:13 AM
Schon wieder schlechte Nachrichten Marc_liest Lounge 13 05-27-2009 02:54 PM


All times are GMT -4. The time now is 12:20 PM.


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