aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xorg/blog/generate-phlog.scm28
1 files changed, 28 insertions, 0 deletions
diff --git a/org/blog/generate-phlog.scm b/org/blog/generate-phlog.scm
new file mode 100755
index 0000000..17f0778
--- /dev/null
+++ b/org/blog/generate-phlog.scm
@@ -0,0 +1,28 @@
+#! /usr/bin/guile \
+-e main -s
+!#
+
+(use-modules (sxml simple))
+
+(define (make-gophermap articles)
+ (call-with-output-file "phlog/gophermap"
+ (lambda (fp)
+ (for-each
+ (lambda (article)
+ (if (list? article)
+ (display article)))
+ (cdr (cadr articles))))))
+
+(define (make-blogs articles)
+ '())
+
+(define (generate-phlog)
+ (call-with-input-file "articles.xml"
+ (lambda (fp)
+ (let ((articles (xml->sxml fp)))
+ (make-gophermap articles)
+ (make-blogs articles)))))
+
+(define (main args)
+ (generate-phlog))
+