From 5f8288eecb97d1e1c5ed807945b84ff4bcffe145 Mon Sep 17 00:00:00 2001 From: pictuga Date: Sat, 28 Jun 2014 01:43:31 +0200 Subject: [PATCH] Add :hungry to fill feeds with long intros --- README.md | 1 + morss/morss.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 2797ca6..8ce56c6 100644 --- a/README.md +++ b/README.md @@ -45,6 +45,7 @@ The arguments are: - `md`: convert articles to Markdown - `nolink`: drop links, but keeps links' inner text - `noref`: drop items' link + - `hungry`: grab full-article even if it already looks long enough - `cache`: only take articles from the cache (ie. don't grab new articles' content), so as to save time - `debug`: to have some feedback from the script execution. Useful for debugging - `theforce`: force download the rss feed diff --git a/morss/morss.py b/morss/morss.py index 89bbe79..14741fa 100644 --- a/morss/morss.py +++ b/morss/morss.py @@ -422,7 +422,7 @@ def Fill(item, cache, options, feedurl='/', fast=False): count_content = count_words(item.content) count_desc = count_words(item.desc) - if max(count_content, count_desc) > 500: + if not options.hungry and max(count_content, count_desc) > 500: if count_desc > count_content: item.content = item.desc del item.desc @@ -430,7 +430,7 @@ def Fill(item, cache, options, feedurl='/', fast=False): log('long enough') return True - if count_content > 5 * count_desc > 0 and count_content > 50: + if not options.hungry and count_content > 5 * count_desc > 0 and count_content > 50: log('content bigger enough') return True