From c2237c2efa9b8b7a35a78f4ce493488b5307bd2b Mon Sep 17 00:00:00 2001 From: yodha8 <104330897+yodha8@users.noreply.github.com> Date: Sat, 30 Apr 2022 22:18:23 -0700 Subject: [PATCH] Remove cruft from Quanta Magazine articles --- recipes/quanta_magazine.recipe | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/recipes/quanta_magazine.recipe b/recipes/quanta_magazine.recipe index 976cdc5870..c11ec81b18 100644 --- a/recipes/quanta_magazine.recipe +++ b/recipes/quanta_magazine.recipe @@ -1,17 +1,28 @@ #!/usr/bin/env python # vim:fileencoding=utf-8 + from __future__ import unicode_literals, division, absolute_import, print_function from calibre.web.feeds.news import BasicNewsRecipe - class Quanta(BasicNewsRecipe): - title = 'Quanta Magazine' + title = "Quanta Magazine" + description = "Articles from the magazine. Please set to download weekly." + oldest_article = 7 max_articles_per_feed = 100 language = 'en' - __author__ = 'lui1' encoding = 'UTF-8' + publication_type = "blog" + cover_url = "https://d2r55xnwy6nx47.cloudfront.net/uploads/2017/05/logo.png" feeds = [ ('Articles', 'https://api.quantamagazine.org/feed/'), ] + + keep_only_tags = [ + dict(name="div", attrs={"id": "postBody"}), + ] + + remove_tags = [ + dict(name="div", attrs={"class": "post__sidebar__content"}), + ]