From 215513510fc15fa24c87a66fdfa31e8985febab6 Mon Sep 17 00:00:00 2001 From: unkn0w7n <51942695+unkn0w7n@users.noreply.github.com> Date: Wed, 28 Feb 2024 10:08:58 +0530 Subject: [PATCH] ... --- recipes/moneycontrol.recipe | 13 +++++++------ recipes/the_week_magazine_free.recipe | 3 ++- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/recipes/moneycontrol.recipe b/recipes/moneycontrol.recipe index 2563b5cf50..4fcc5c5760 100644 --- a/recipes/moneycontrol.recipe +++ b/recipes/moneycontrol.recipe @@ -16,6 +16,7 @@ class MoneyControlRecipe(BasicNewsRecipe): ignore_duplicate_articles = {'title', 'url'} remove_empty_feeds = True resolve_internal_links = True + oldest_article = 1 # days extra_css = ''' img {display:block; margin:0 auto;} @@ -65,7 +66,7 @@ class MoneyControlRecipe(BasicNewsRecipe): feeds = [] - when = 27 # hours + when = oldest_article*24 index = 'https://www.moneycontrol.com/' business_sections = [ @@ -73,12 +74,12 @@ class MoneyControlRecipe(BasicNewsRecipe): 'personal-finance', 'commodities', 'trade', 'companies' ] - a = 'https://news.google.com/rss/search?q=when:{}h+allinurl:{}{}&hl=en-IN&gl=IN&ceid=IN:en' + a = 'https://news.google.com/rss/search?q=when:{}h+allinurl:{}&hl=en-IN&gl=IN&ceid=IN:en' for sec in business_sections: allinurl_a = index + 'news/business' - feeds.append((sec.capitalize(), a.format(when, quote(allinurl_a, safe=''), '%2F' + sec + '%2F'))) - feeds.append(('Business' , a.format(when, quote(allinurl_a, safe=''), ''))) + feeds.append((sec.capitalize(), a.format(when, quote(allinurl_a + sec, safe='')))) + feeds.append(('Business' , a.format(when, quote(allinurl_a + sec, safe='')))) news_sections = [ 'india', 'world', 'opinion', 'politics', 'technology', 'trends', 'lifestyle' @@ -86,8 +87,8 @@ class MoneyControlRecipe(BasicNewsRecipe): for sec in news_sections: allinurl_b = index + 'news' - feeds.append((sec.capitalize(), a.format(when, quote(allinurl_b, safe=''), '%2F' + sec + '%2F'))) - feeds.append(('News', a.format(when, quote(allinurl_b, safe=''), ''))) + feeds.append((sec.capitalize(), a.format(when, quote(allinurl_b + sec, safe='')))) + feeds.append(('News', a.format(when, quote(allinurl_b + sec, safe=''), ''))) feeds.append( ('Others', 'https://news.google.com/rss/search?q=when:{}h+allinurl:{}&hl=en-IN&gl=IN&ceid=IN:en'.format(when, quote(index, safe=''))) ) diff --git a/recipes/the_week_magazine_free.recipe b/recipes/the_week_magazine_free.recipe index c424635e93..db4a44acaa 100644 --- a/recipes/the_week_magazine_free.recipe +++ b/recipes/the_week_magazine_free.recipe @@ -24,6 +24,7 @@ class TheWeek(BasicNewsRecipe): remove_empty_feeds = True resolve_internal_links = True simultaneous_downloads = 1 + oldest_article = 7 # days web_url = '' extra_css = ''' @@ -74,7 +75,7 @@ class TheWeek(BasicNewsRecipe): return soup feeds = [] - when = '168' # hours (7 days) + when = oldest_article*24 index = 'https://theweek.com/' sections = [ 'politics', 'news', 'cartoons', 'tech', 'science', 'health',