From d3bc2926fc5c6e3daad944afec3d603fb6a3f8b0 Mon Sep 17 00:00:00 2001 From: pictuga Date: Sat, 25 Mar 2017 13:52:58 -1000 Subject: [PATCH] Remove :hungry Mostly usless. If you need it, you might as well not need to use morss in the first place... --- README.md | 1 - morss/morss.py | 23 +---------------------- 2 files changed, 1 insertion(+), 23 deletions(-) diff --git a/README.md b/README.md index ad73f13..458a761 100644 --- a/README.md +++ b/README.md @@ -67,7 +67,6 @@ The arguments are: - `indent`: returns indented XML or JSON, takes more place, but human-readable - `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 - `mono`: disable multithreading while fetching, makes debugging easier diff --git a/morss/morss.py b/morss/morss.py index 8ec8a15..f01fa7d 100644 --- a/morss/morss.py +++ b/morss/morss.py @@ -199,22 +199,6 @@ def ItemFill(item, options, feedurl='/', fast=False): log(item.link) - # content already provided? - count_content = count_words(item.content) - count_desc = count_words(item.desc) - - if not options.hungry and max(count_content, count_desc) > 500: - if count_desc > count_content: - item.content = item.desc - del item.desc - log('reversed sizes') - log('long enough') - return True - - if not options.hungry and count_content > 5 * count_desc > 0 and count_content > 50: - log('content bigger enough') - return True - link = item.link # twitter @@ -261,12 +245,7 @@ def ItemFill(item, options, feedurl='/', fast=False): out = readabilite.get_article(data, options.encoding or crawler.detect_encoding(data, con)) - if options.hungry or count_words(out) > max(count_content, count_desc): - item.push_content(out) - - else: - log('link not bigger enough') - return True + item.content = out return True