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 05-14-2011, 12:48 PM   #1
schuster
Zealot
schuster doesn't litterschuster doesn't litter
 
Posts: 119
Karma: 100
Join Date: Jan 2011
Location: Germany / NRW /Köln
Device: prs-650 / prs-350 /kindle 3
recipe for scientific publication - Max Planck Inst. - 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'Max-Planck-Inst.'
    __author__  = 'schuster'
    remove_tags = [dict(attrs={'class':['clearfix', 'lens', 'col2_box_list', 'col2_box_teaser group_ext no_print', 'dotted_line', 'col2_box_teaser', 'box_image small', 'bold', 'col2_box_teaser no_print', 'print_kontakt']}),
                dict(id=['ie_clearing', 'col2', 'col2_content']),
                dict(name=['script', 'noscript', 'style'])]
    oldest_article = 30
    max_articles_per_feed = 100
    no_stylesheets         = True
    use_embedded_content   = False
    language               = 'de'
    remove_javascript      = True

    def print_version(self, url):
	split_url = url.split("/")
	print_url = 'http://www.mpg.de/print/' +  split_url[3]
	return print_url

    feeds          = [(u'Forschung', u'http://www.mpg.de/de/forschung.rss')]
schuster is offline   Reply With Quote
Old 06-05-2011, 09:59 AM   #2
schuster
Zealot
schuster doesn't litterschuster doesn't litter
 
Posts: 119
Karma: 100
Join Date: Jan 2011
Location: Germany / NRW /Köln
Device: prs-650 / prs-350 /kindle 3
**Update**

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

    title          = u'Max-Planck-Inst.'
    __author__  = 'schuster'
    oldest_article = 30
    max_articles_per_feed = 100
    no_stylesheets         = True
    use_embedded_content   = False
    language               = 'de'
    remove_javascript      = True

    remove_tags = [dict(attrs={'class':['box_url', 'print_kontakt']}),
                dict(id=['skiplinks'])]



    def print_version(self, url):
        split_url = url.split("/")
        print_url = 'http://www.mpg.de/print/' +  split_url[3]
        return print_url

    feeds          = [(u'Forschung', u'http://www.mpg.de/de/forschung.rss')]
schuster is offline   Reply With Quote
Advert
Old 04-29-2012, 11:56 AM   #3
a.peter
Enthusiast
a.peter began at the beginning.
 
Posts: 28
Karma: 10
Join Date: Sep 2011
Device: Sony PRS-350, Kindle Touch
Update

The site of the Max-Planck-Society change. I've overhauled the recipy.

max_planck.recipe.txt

It would be fine if you could add this one to one of the next Calibre releases.

Thanx and have a nice day.

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

    title                  = u'Max-Planck-Gesellschaft'
    description            = 'Forschungs-News-Feed der Max-Planck-Gesellschaft'
    __author__             = 'schuster, a.peter'
    __license__            = 'GPL v3'
    version                = 2
    
    oldest_article         = 30
    max_articles_per_feed  = 100
    no_stylesheets         = True
    use_embedded_content   = False
    language               = 'de'
    remove_javascript      = True
    timefmt                = ' [%d.%m.%Y]' 

    remove_tags = [dict(attrs={'class':['box_url', 'print_kontakt']}),
                dict(id=['skiplinks']),
                dict(name='div', attrs={'id':['print_options','print_head']}),
                dict(name='div', attrs={'class':['col2_box_meta']}),
                dict(name='a', attrs={'class':['toggle_description']}),
                dict(name='span', attrs={'class':['lens']})]

    def print_version(self, url):
        print_url = url + '?print=yes'
        return print_url

    feeds = [(u'Forschung', u'http://www.mpg.de/de/forschung.rss')]

    def get_masthead_url(self):
        return 'http://www.mpg.de/images/logo_print.png'
a.peter is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Scientific American recipe broken (?) jamesewood Calibre 4 09-23-2010 03:37 PM
Other Fiction Dauthenday, Max: Lingam german 14.11.2009 Insider ePub Books 0 11-13-2009 11:19 PM
Other Fiction Dauthenday, Max: Raubmenschen german 14.11.2009 Insider ePub Books 0 11-13-2009 10:53 PM
Scientific American recipe Stingo Calibre 2 10-30-2009 05:42 PM
Seriously thoughtful Herschel/Planck telescopes successfully launched HarryT Lounge 4 05-14-2009 10:57 AM


All times are GMT -4. The time now is 11:16 PM.


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