Remove :hungry
Mostly usless. If you need it, you might as well not need to use morss in the first place...master
parent
505b02d70d
commit
d3bc2926fc
|
@ -67,7 +67,6 @@ The arguments are:
|
||||||
- `indent`: returns indented XML or JSON, takes more place, but human-readable
|
- `indent`: returns indented XML or JSON, takes more place, but human-readable
|
||||||
- `nolink`: drop links, but keeps links' inner text
|
- `nolink`: drop links, but keeps links' inner text
|
||||||
- `noref`: drop items' link
|
- `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
|
- `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
|
- `debug`: to have some feedback from the script execution. Useful for debugging
|
||||||
- `mono`: disable multithreading while fetching, makes debugging easier
|
- `mono`: disable multithreading while fetching, makes debugging easier
|
||||||
|
|
|
@ -199,22 +199,6 @@ def ItemFill(item, options, feedurl='/', fast=False):
|
||||||
|
|
||||||
log(item.link)
|
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
|
link = item.link
|
||||||
|
|
||||||
# twitter
|
# 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))
|
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.content = out
|
||||||
item.push_content(out)
|
|
||||||
|
|
||||||
else:
|
|
||||||
log('link not bigger enough')
|
|
||||||
return True
|
|
||||||
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue