From 6e33ad712e4bc2d1625a4f8e09a1b30fb60fad80 Mon Sep 17 00:00:00 2001 From: dreamer Date: Mon, 27 Apr 2026 11:15:55 +0200 Subject: [PATCH] add latest date and podcast:guid --- code/app.lua | 9 ++++++--- code/handlers/RSShandler.lua | 1 + code/hotmixes/utils.lua | 9 +++++++++ code/views/rss.etlua | 2 ++ 4 files changed, 18 insertions(+), 3 deletions(-) diff --git a/code/app.lua b/code/app.lua index c2cd8f2..13a02ae 100644 --- a/code/app.lua +++ b/code/app.lua @@ -16,21 +16,24 @@ if string.find(ngx.var.host, "panamaracing.club") then name = "Panama Racing Club Archive", url = "panamaracing.club", css = "panamaracing.css", - header = "panamaracing.club_header.png" + header = "panamaracing.club_header.png", + feed = "panamaracing.club" } elseif string.find(ngx.var.host, "videohotmix.net") then page_titles = { name = "Hotmix Video Archive", url = "videohotmix.net", css = "videohotmix.css", - header = "videohotmix.net-logo.png" + header = "videohotmix.net-logo.png", + feed = "videohotmix" } elseif string.find(ngx.var.host, "hotmixxx.com") then page_titles = { name = "Hotmix Video Archive", url = "videohotmix.net", css = "videohotmix.css", - header = "videohotmix.net-logo.png" + header = "videohotmix.net-logo.png", + feed = "hotmixxx" } else page_titles = { diff --git a/code/handlers/RSShandler.lua b/code/handlers/RSShandler.lua index 85a18fb..c02d998 100644 --- a/code/handlers/RSShandler.lua +++ b/code/handlers/RSShandler.lua @@ -15,6 +15,7 @@ local function RSShandler(self) self.latestname = latest_name self.latestsize = latest_size self.latestdate = latest_date + self.datenow = hotmixes.utils.rss_date_now() return { content_type = "application/rss+xml", layout = require "views.rss" } end diff --git a/code/hotmixes/utils.lua b/code/hotmixes/utils.lua index 196022e..6c63801 100644 --- a/code/hotmixes/utils.lua +++ b/code/hotmixes/utils.lua @@ -190,4 +190,13 @@ utils['total_files_dir'] = function( path ) return t end +utils['rss_date_now'] = function() + local popen = io.popen + local pdate = popen('date "+%a, %-d %b %Y %H:%M:%S %Z"') + for date in pdate:lines() do + return date + end + pdate:close() +end + return utils diff --git a/code/views/rss.etlua b/code/views/rss.etlua index ef9a854..8c76aff 100644 --- a/code/views/rss.etlua +++ b/code/views/rss.etlua @@ -22,6 +22,8 @@ + <%= datenow %> + intergalactic-fm-<%= titles['feed'] %>-feed <% for i, file in ipairs(latestpath) do %>