Add :hungry to fill feeds with long intros

master
pictuga 2014-06-28 01:43:31 +02:00
parent ac69b28f1b
commit 5f8288eecb
2 changed files with 3 additions and 2 deletions

View File

@ -45,6 +45,7 @@ The arguments are:
- `md`: convert articles to Markdown - `md`: convert articles to Markdown
- `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
- `theforce`: force download the rss feed - `theforce`: force download the rss feed

View File

@ -422,7 +422,7 @@ def Fill(item, cache, options, feedurl='/', fast=False):
count_content = count_words(item.content) count_content = count_words(item.content)
count_desc = count_words(item.desc) 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: if count_desc > count_content:
item.content = item.desc item.content = item.desc
del item.desc del item.desc
@ -430,7 +430,7 @@ def Fill(item, cache, options, feedurl='/', fast=False):
log('long enough') log('long enough')
return True 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') log('content bigger enough')
return True return True