diff --git a/recipes/icons/harpers.png b/recipes/icons/harpers.png index 2bcd486ad1..422b94014d 100644 Binary files a/recipes/icons/harpers.png and b/recipes/icons/harpers.png differ diff --git a/recipes/icons/military_history.png b/recipes/icons/military_history.png index c991353513..52cf036779 100644 Binary files a/recipes/icons/military_history.png and b/recipes/icons/military_history.png differ diff --git a/recipes/icons/minerva_magazine.png b/recipes/icons/minerva_magazine.png index 1e3585c000..53e1124af9 100644 Binary files a/recipes/icons/minerva_magazine.png and b/recipes/icons/minerva_magazine.png differ diff --git a/recipes/icons/nautilus.png b/recipes/icons/nautilus.png index eeeb38d263..89c00fc814 100644 Binary files a/recipes/icons/nautilus.png and b/recipes/icons/nautilus.png differ diff --git a/recipes/icons/new_scientist_mag.png b/recipes/icons/new_scientist_mag.png index 844c1e951c..cc04bfb404 100644 Binary files a/recipes/icons/new_scientist_mag.png and b/recipes/icons/new_scientist_mag.png differ diff --git a/recipes/icons/nikkeiasia.png b/recipes/icons/nikkeiasia.png index 92f1ee523f..65172b9f88 100644 Binary files a/recipes/icons/nikkeiasia.png and b/recipes/icons/nikkeiasia.png differ diff --git a/recipes/icons/the_week_magazine_free.png b/recipes/icons/the_week_magazine_free.png index 28afccf9e3..073161d5b6 100644 Binary files a/recipes/icons/the_week_magazine_free.png and b/recipes/icons/the_week_magazine_free.png differ diff --git a/recipes/icons/the_week_uk.png b/recipes/icons/the_week_uk.png index 28afccf9e3..073161d5b6 100644 Binary files a/recipes/icons/the_week_uk.png and b/recipes/icons/the_week_uk.png differ diff --git a/recipes/icons/times_online.png b/recipes/icons/times_online.png index 61447d8965..94bf20cda2 100644 Binary files a/recipes/icons/times_online.png and b/recipes/icons/times_online.png differ diff --git a/recipes/icons/tls_mag.png b/recipes/icons/tls_mag.png index 21391b1fec..2ff2938c1f 100644 Binary files a/recipes/icons/tls_mag.png and b/recipes/icons/tls_mag.png differ diff --git a/recipes/icons/toi.png b/recipes/icons/toi.png index 1c6911c2b7..fbf1778e7c 100644 Binary files a/recipes/icons/toi.png and b/recipes/icons/toi.png differ diff --git a/recipes/icons/toiprint.png b/recipes/icons/toiprint.png index 1c6911c2b7..fbf1778e7c 100644 Binary files a/recipes/icons/toiprint.png and b/recipes/icons/toiprint.png differ diff --git a/recipes/icons/world_archeology.png b/recipes/icons/world_archeology.png index 363717470a..c03c4e6ff8 100644 Binary files a/recipes/icons/world_archeology.png and b/recipes/icons/world_archeology.png differ diff --git a/recipes/icons/wsj.png b/recipes/icons/wsj.png index 5fb5496c5a..33eb9f371f 100644 Binary files a/recipes/icons/wsj.png and b/recipes/icons/wsj.png differ diff --git a/recipes/icons/wsj_mag.png b/recipes/icons/wsj_mag.png index 5fb5496c5a..33eb9f371f 100644 Binary files a/recipes/icons/wsj_mag.png and b/recipes/icons/wsj_mag.png differ diff --git a/recipes/icons/wsj_news.png b/recipes/icons/wsj_news.png index 5fb5496c5a..33eb9f371f 100644 Binary files a/recipes/icons/wsj_news.png and b/recipes/icons/wsj_news.png differ diff --git a/recipes/icons/znetwork.png b/recipes/icons/znetwork.png new file mode 100644 index 0000000000..3e72c63843 Binary files /dev/null and b/recipes/icons/znetwork.png differ diff --git a/recipes/znetwork.recipe b/recipes/znetwork.recipe new file mode 100644 index 0000000000..bde5a325b6 --- /dev/null +++ b/recipes/znetwork.recipe @@ -0,0 +1,69 @@ +#!/usr/bin/env python +from calibre.web.feeds.news import BasicNewsRecipe, classes + + +class znetwork(BasicNewsRecipe): + title = 'ZNetwork' + __author__ = 'unkn0wn' + language = 'en' + description = 'ZNetwork: Left News, Analysis, Vision & Strategy' + oldest_article = 2 + no_stylesheets = True + encoding = 'utf-8' + remove_javascript = True + use_embedded_content = False + remove_attributes = ['style', 'height', 'width'] + masthead_url = 'https://znetwork.org/wp-content/uploads/2022/08/Z_logo_64.png' + ignore_duplicate_articles = {'url'} + browser_type = 'qt' + + recipe_specific_options = { + 'days': { + 'short': 'Oldest article to download from this news source. In days ', + 'long': 'For example, 0.5, gives you articles from the past 12 hours', + 'default': str(oldest_article) + } + } + + def __init__(self, *args, **kwargs): + BasicNewsRecipe.__init__(self, *args, **kwargs) + d = self.recipe_specific_options.get('days') + if d and isinstance(d, str): + self.oldest_article = float(d) + + extra_css = ''' + .cat-labels { font-size:small; color:#404040; } + .post-author, .date, .author-info, .z-post-source, .read-time { font-size:small; } + .sub-title { font-style:italic; color:#202020; } + em, blockquote { color:#202020; } + .wp-caption-text, .wp-element-caption { font-size:small; text-align:center; } + ''' + + keep_only_tags = [ + classes( + 'cat-labels post-title z-post-source sub-title post-author date' + ' read-time featured entry-content author-info' + ) + ] + + remove_tags = [ + dict(name=['aside', 'svg', 'source', 'iframe']), + classes('support-z-text yarpp-related yarpp-related-website') + ] + + remove_tags_after = [classes('author-info')] + + feeds = [('Articles', 'https://znetwork.org/feed/')] + + def preprocess_html(self, soup): + for spn in soup.findAll(**classes('post-author date')): + spn.string = spn.text + ' | ' + div = soup.findAll(**classes('featured')) + if div: + div.name = 'p' + p = soup.findAll(**classes('sub-title')) + if p: + p.name = 'p' + for h in soup.findAll(['h2', 'h3']): + h.name = 'h4' + return soup