From 28ead874a307f0fae3de6b01f7db900f7f93db65 Mon Sep 17 00:00:00 2001 From: Paul Wilde Date: Wed, 18 Dec 2024 18:06:47 +0000 Subject: [PATCH] bunp version --- src/genpage.nim | 15 ++++++++++++--- src/resources/rss_start | 11 +++++++---- 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/src/genpage.nim b/src/genpage.nim index f2edb74..b65f1ce 100644 --- a/src/genpage.nim +++ b/src/genpage.nim @@ -1,5 +1,5 @@ import httpclient -import os, strutils, strformat, tables, re, sugar, uri +import os, strutils, strformat, tables, re, sugar, uri, times type Urls = seq[string] @@ -120,7 +120,8 @@ proc compilePage(content: string, video_uri: string = "", search_query: string = return page proc compileRSSPage(content: string, search_query: string = ""): string = - var rss = RESOURCES["rss_start"] + var rss = RESOURCES["rss_start"].replace("Pimvidious",fmt"Pimvidious {search_query}") + rss = rss.replace("BUILDDATE", now().format("YYYY-MM-dd'T'HH:mm:ss")) let urls = parseUrls(content) let thumbs = parseThumbs(content) for idx, url in urls: @@ -133,7 +134,15 @@ proc compileRSSPage(content: string, search_query: string = ""): string = vid_url = url.replace("THUMBNUM","1") vid_thumb = thumbs[^1].replace("THUMBNUM","1") let title = vid_url.split("/")[^1].replace("_"," ") - rss &= fmt"""{title}</titcle><link>{vid_url}</link><description>{title}</description><image><title>{title}{vid_thumb}""" + rss &= fmt""" + + {url} + {title} + {vid_url} + {title} + + + """ rss &= RESOURCES["rss_end"] return rss diff --git a/src/resources/rss_start b/src/resources/rss_start index 64b0b2b..411dc93 100644 --- a/src/resources/rss_start +++ b/src/resources/rss_start @@ -1,4 +1,7 @@ - - -Pimvidious -https://example.com + + + + Pimvidious + BASEURL + BUILDDATE + Pimvidious