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-10-2017, 04:28 PM   #1
lutze
Junior Member
lutze began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Nov 2017
Device: tolino vision 2
New recipe for Telepolis

The current recipe for the german online magazine Telepolis is broken. I tried a new one:
Code:
#!/usr/bin/env python2
# vim:fileencoding=utf-8
from __future__ import unicode_literals, division, absolute_import, print_function
from calibre.web.feeds.news import BasicNewsRecipe


class Telepolis(BasicNewsRecipe):
    title = 'Telepolis'
    __author__ = 'Lutz Epperlein'
    oldest_article = 7
    max_articles_per_feed = 100
    auto_cleanup   = False
    language = 'de'

    feeds          = [
        ('Telepolis', 'https://www.heise.de/tp/news-atom.xml'),
    ]

    remove_tags = [dict(name='p', attrs={'class':'printversion__back-to-article printversion--hide'})]

    def get_article_url(self, article):
        return article.link + "?view=print"
Works well so far, at least in my calibre installation. Please have a look.

Regards
Lutz
lutze is offline   Reply With Quote
Old 11-10-2017, 06:54 PM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,850
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
https://github.com/kovidgoyal/calibr...67e0d9948010b7
kovidgoyal is offline   Reply With Quote
Advert
Old 11-18-2018, 11:58 AM   #3
lutze
Junior Member
lutze began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Nov 2017
Device: tolino vision 2
Slightly change of Telepolis recipe

I changed the recipe for Telepolis.de again since the publisher changed something too.
Here is the new one:
Code:
#!/usr/bin/env python2
# vim:fileencoding=utf-8
from __future__ import unicode_literals, division, absolute_import, print_function
from calibre.web.feeds.news import BasicNewsRecipe

class Telepolis(BasicNewsRecipe):
    title = 'Telepolis'
    __author__ = 'Lutz Epperlein'
    oldest_article = 10
    max_articles_per_feed = 200
    auto_cleanup   = False
    language = 'de'
    scale_news_images = (758, 1024)
    scale_news_images_to_device = True

    feeds          = [
        ('Telepolis', 'https://www.heise.de/tp/news-atom.xml'),
    ]

    remove_tags = [dict(name='p', attrs={'class':'printversion__back-to-article printversion--hide'})]

    def get_article_url(self, article):
        return article.link + "&view=print"
The only change is the '&' instead of '?' for url parameters (and the scaling of images).

Regards
Lutz

Last edited by lutze; 11-18-2018 at 12:00 PM. Reason: forgot to mention the scaling
lutze is offline   Reply With Quote
Reply

Tags
magazine, magazine to epub


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Telepolis recipe broken New924249 Recipes 3 05-15-2017 11:15 PM
Recipe works when mocked up as Python file, fails when converted to Recipe ode Recipes 7 09-04-2011 04:57 AM
Updated Telepolis (News+Artikel) Recipe syntaxis Recipes 8 05-15-2011 06:40 AM
Calibre Recipe: Telepolis (Artikel) (German) lena_punkt Calibre 1 09-27-2010 05:03 AM
Calibre und Telepolis imp.palpatine Software 4 08-31-2009 03:06 AM


All times are GMT -4. The time now is 05:07 AM.


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