#!/usr/bin/env gosh
;;
;; index.cgi - listing logs
;;
(require "../setting")
(sys-chdir log-dir)
(display "Content-type: text/html\r\n\r\n")
(print "
" irc-channel "
" irc-channel " IRC logs
"
(string-join (map (lambda (path)
(let1 date-str (regexp-replace #/\.log$/ path "")
#`"- ,|date-str|
\n"))
(reverse! (sort! (glob "20[0-9][0-9]-[01][0-9]-[0-3][0-9].log")))) "")
"
")