Remove :hungry

Mostly usless. If you need it, you might as well not need to use morss in the first place...
master
pictuga 2017-03-25 13:52:58 -10:00
parent 505b02d70d
commit d3bc2926fc
2 changed files with 1 additions and 23 deletions

View File

@ -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

View File

@ -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