mirror of
https://github.com/tanrax/RSSingle.git
synced 2024-11-10 04:05:41 +01:00
Add var config max entries
Use `max_entries` as YAML key. Co-authored-by: Dom Rodriguez <shymega@shymega.org.uk>
This commit is contained in:
parent
846de90642
commit
dd16696103
@ -35,6 +35,7 @@ title: My RSS Feed
|
|||||||
description: My customised RSS feed with technology news
|
description: My customised RSS feed with technology news
|
||||||
url: https://www.example.com
|
url: https://www.example.com
|
||||||
output: rss.xml
|
output: rss.xml
|
||||||
|
max_entries: 5 # Delete this line to get all
|
||||||
feeds:
|
feeds:
|
||||||
- https://programadorwebvalencia.com/feed/
|
- https://programadorwebvalencia.com/feed/
|
||||||
- https://republicaweb.es/feed/
|
- https://republicaweb.es/feed/
|
||||||
|
@ -2,6 +2,7 @@ title: My RSS Feed
|
|||||||
description: My customised RSS feed with technology news
|
description: My customised RSS feed with technology news
|
||||||
url: https://www.example.com
|
url: https://www.example.com
|
||||||
output: rss.xml
|
output: rss.xml
|
||||||
|
max_entries: 2 # Delete this line to get all
|
||||||
feeds:
|
feeds:
|
||||||
- https://programadorwebvalencia.com/feed/
|
- https://programadorwebvalencia.com/feed/
|
||||||
- https://republicaweb.es/feed/
|
- https://republicaweb.es/feed/
|
@ -97,7 +97,7 @@ def main():
|
|||||||
rss = parse_rss_feed(feed)
|
rss = parse_rss_feed(feed)
|
||||||
entries = rss.get("entries")
|
entries = rss.get("entries")
|
||||||
log.debug("Iterating over [input] feed entries..")
|
log.debug("Iterating over [input] feed entries..")
|
||||||
for entry in entries:
|
for entry in entries[:CONFIG["max_entries"]] if "max_entries" in CONFIG else entries:
|
||||||
log.debug("New feed entry created.")
|
log.debug("New feed entry created.")
|
||||||
|
|
||||||
fe = fg.add_entry()
|
fe = fg.add_entry()
|
||||||
|
Loading…
Reference in New Issue
Block a user