Add :hungry to fill feeds with long intros
parent
ac69b28f1b
commit
5f8288eecb
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue