MobileRead Forums

MobileRead Forums (https://www.mobileread.com/forums/index.php)
-   Recipes (https://www.mobileread.com/forums/forumdisplay.php?f=228)
-   -   recipe for Pro Physik - german (https://www.mobileread.com/forums/showthread.php?t=133184)

schuster 05-14-2011 01:52 PM

recipe for Pro Physik - german
 
Code:

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

    title          = u'Pro Physik'
    __author__  = 'schuster'
    oldest_article = 4
    max_articles_per_feed = 100
    no_stylesheets        = True
    use_embedded_content  = False
    language              = 'de'
    remove_javascript      = True
    cover_url = 'http://www.pro-physik.de/Phy/images/site/prophysik_logo1.jpg'

 
    def print_version(self, url):
        return url.replace('leadArticle.do', 'print.do')


    feeds          = [(u'Hightech', u'http://www.pro-physik.de/Phy/hightechfeed.xml'),
                          (u'Forschung', u'http://www.pro-physik.de/Phy/forschungfeed.xml'),
                          (u'Magazin', u'http://www.pro-physik.de/Phy/magazinfeed.xml')]


Divingduck 11-28-2012 08:05 AM

1 Attachment(s)
Please find below an update for this recipe. Feel free to use it and/or modify it to your needs.

Spoiler:
Code:

from calibre.web.feeds.recipes import BasicNewsRecipe
class AdvancedUserRecipe1303841067(BasicNewsRecipe):

    title          = u'Pro Physik'
    __author__  = 'schuster, Armin Geller' # AGE Upd. 2012-11-28
    oldest_article        = 4
    max_articles_per_feed = 100

    no_stylesheets        = True
    remove_javascript    = True
    remove_empty_feeds    = True
    language              = 'de_DE'   
   
    cover_url = 'http://www.pro-physik.de/prophy/images/bg_logo_prophy.gif'


    keep_only_tags    = [
                          dict(name='div', attrs={'class':['leftColRight']})
                        ]
                       
    remove_tags = [
                    dict(name='div', attrs={'class':["withMargin socialWrapper addthis_toolbox addthis_default_style"]}),
                  # AGe: If you don't like to see further informations for the article
                  #      and additional links please remove # in belows next line
#                    dict(name='div', attrs={'class':["insideBox"]}),
                  ]

    feeds = [
              (u'Nachrichten', u'http://www.pro-physik.de/graphicalrss/prophy/newsFeed.xml'),
              (u'Forschung', u'http://www.pro-physik.de/graphicalrss/prophy/newsforschungFeed.xml'),
              (u'Techologie', u'http://www.pro-physik.de/graphicalrss/prophy/newstechnologieFeed.xml'),
              (u'Industrie', u'http://www.pro-physik.de/graphicalrss/prophy/newsindustrieFeed.xml'),
              (u'Hochschule', u'http://www.pro-physik.de/graphicalrss/prophy/newshochschuleFeed.xml'),
              (u'Panorama', u'http://www.pro-physik.de/graphicalrss/prophy/newspanoramaFeed.xml'),
              (u'DPG', u'http://www.pro-physik.de/graphicalrss/prophy/newsdpgFeed.xml'),
              (u'Physik Jornal', u'http://www.pro-physik.de/graphicalrss/prophy/pjnewsFeed.xml'),
              (u'Veranstaltungen', u'http://www.pro-physik.de/rss/prophy/eventsFeed.xml'),

              # AGe if you like to see job offers please remove # on next lines below
             
#              (u'Stellenmarkt', u'http://www.pro-physik.de/rss/prophy/jobsFeed.xml'),
#              (u'Industrie Stellenanzeigen', u'http://www.pro-physik.de/rss/prophy/jobsindustrieFeed.xml'),
#              (u'PhD Stellenanzeigen', u'http://www.pro-physik.de/rss/prophy/jobsphdFeed.xml'),
#              (u'PostDoc Stellenanzeigen', u'http://www.pro-physik.de/rss/prophy/jobspostdocFeed.xml'),
#              (u'Öffentlicher Dienst Stellenanzeigen', u'http://www.pro-physik.de/rss/prophy/jobsdienstFeed.xml'),
#              (u'Hochschule Stellenanzeigen', u'http://www.pro-physik.de/rss/prophy/jobshochschuleFeed.xml'),
            ]


dkosse 11-30-2012 03:52 AM

Hei divingduck,

thank you very much but as wit Aachener nachrichten, yesterdey no probs with Sony connected, today with Pocketbook pro an error message.

If you have a hint?

Best regards

dkosse

dkosse 11-30-2012 03:59 AM

Hi,

I have just tried with Sony T1 reader connected, the following error message:

'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

'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

Divingduck 11-30-2012 04:52 AM

Just check the recipe with Calibre 0.9.8. Can't see any problems with the recipe.
Best regards, DD

dkosse 11-30-2012 10:39 AM

With 0.9.8 no probs.

Many thanks!

dkosse

Divingduck 02-09-2019 07:18 AM

1 Attachment(s)
Please find below an update for this recipe. Feel free to use it and/or modify it to your needs.


All times are GMT -4. The time now is 09:05 PM.

Powered by: vBulletin
Copyright ©2000 - 3.8.5, Jelsoft Enterprises Ltd.
MobileRead.com is a privately owned, operated and funded community.