This commit is contained in:
parent
52cb376335
commit
ab85f65044
2 changed files with 19 additions and 1 deletions
|
|
@ -3,12 +3,20 @@ name = "releases"
|
||||||
[[feeds]]
|
[[feeds]]
|
||||||
url = "https://github.com/nim-lang/Nim/releases.atom"
|
url = "https://github.com/nim-lang/Nim/releases.atom"
|
||||||
kind = "Atom"
|
kind = "Atom"
|
||||||
|
titlePrefix = "Nim: "
|
||||||
|
|
||||||
[[feeds]]
|
[[feeds]]
|
||||||
url = "https://github.com/fatedier/frp/releases.atom"
|
url = "https://github.com/fatedier/frp/releases.atom"
|
||||||
kind = "Atom"
|
kind = "Atom"
|
||||||
|
titlePrefix = "frp: "
|
||||||
|
|
||||||
[[feeds]]
|
[[feeds]]
|
||||||
url = "https://forgejo.org/releases/rss.xml"
|
url = "https://forgejo.org/releases/rss.xml"
|
||||||
kind = "RSSv2"
|
kind = "RSSv2"
|
||||||
timeFormat = "ddd',' dd MMM yyyy HH:mm:ss 'GMT'"
|
titlePrefix = "Forgejo: "
|
||||||
|
timeFormat = "ddd',' dd MMM yyyy HH:mm:ss 'GMT'"
|
||||||
|
|
||||||
|
[[feeds]]
|
||||||
|
url = "https://github.com/project-zot/zot/releases.atom"
|
||||||
|
titlePrefix = "zot: "
|
||||||
|
kind = "Atom"
|
||||||
10
src/rss.nim
10
src/rss.nim
|
|
@ -9,6 +9,7 @@ type RssFeed* = object
|
||||||
url*: string
|
url*: string
|
||||||
kind*: FeedType
|
kind*: FeedType
|
||||||
timeFormat*: string
|
timeFormat*: string
|
||||||
|
titlePrefix*: string
|
||||||
|
|
||||||
proc parseAtomTime(s: string): DateTime =
|
proc parseAtomTime(s: string): DateTime =
|
||||||
parse(s, atomTimeFormat)
|
parse(s, atomTimeFormat)
|
||||||
|
|
@ -57,6 +58,15 @@ proc mixRssFeeds*(feeds: seq[RssFeed], name, id, link, authorName, description:s
|
||||||
item
|
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:
|
for feed in entries:
|
||||||
result.items.add feed.items
|
result.items.add feed.items
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue