From b5be88122ca11a2d43ef989904d4b96f72a306c8 Mon Sep 17 00:00:00 2001 From: Jan Tuomi Date: Tue, 26 Mar 2024 15:21:51 +0200 Subject: Add RSS generation --- feed.scm | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) (limited to 'feed.scm') diff --git a/feed.scm b/feed.scm index 546fcc6..de1d4ac 100644 --- a/feed.scm +++ b/feed.scm @@ -2,8 +2,25 @@ (import scheme (chicken base) (chicken format) - atom) + (chicken file) + (chicken io) + (chicken process) + (chicken pathname) + utils) - (define (generate-feed archive-dir) - ;; TODO generate feed with https://wiki.call-cc.org/eggref/5/atom or pandoc-rss - (printf "TODO generate-feed \"~A\"~%" archive-dir))) + (define (generate-feed archive-dir out-dir) + (define paths (glob (format "~A/*" archive-dir))) + (define output-port + (process "pandoc-rss" + (apply list "-s" + "-t" "jan's garden" + "-d" "RSS feed for Jan's personal digital garden" + "-l" "https://jan.systems" + "-f" "%s" + "-n" "en-GB" + "-c" "CC BY-SA 4.0" + "-w" "https://jan.systems" + paths))) + (define output (read-string #f output-port)) + (with-output-to-file (make-pathname out-dir "feed.xml") + (λ () (print output))))) -- cgit v1.3