This commit is contained in:
parent
52cb376335
commit
ab85f65044
2 changed files with 19 additions and 1 deletions
10
src/rss.nim
10
src/rss.nim
|
|
@ -9,6 +9,7 @@ type RssFeed* = object
|
|||
url*: string
|
||||
kind*: FeedType
|
||||
timeFormat*: string
|
||||
titlePrefix*: string
|
||||
|
||||
proc parseAtomTime(s: string): DateTime =
|
||||
parse(s, atomTimeFormat)
|
||||
|
|
@ -57,6 +58,15 @@ proc mixRssFeeds*(feeds: seq[RssFeed], name, id, link, authorName, description:s
|
|||
item
|
||||
)
|
||||
|
||||
if feed.titlePrefix.len > 0:
|
||||
entries[^1].items = entries[^1].items.mapIt(
|
||||
block:
|
||||
var item = it
|
||||
if item.title.isSome():
|
||||
item.title = some(feed.titlePrefix&item.title.get())
|
||||
item
|
||||
)
|
||||
|
||||
for feed in entries:
|
||||
result.items.add feed.items
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue