View Single Post
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