|
Revision 45, 0.8 kB
(checked in by naoya_t, 17 years ago)
|
|
irc-logger : modified htdocs/index.cgi - sorting globbed filenames
|
-
Property svn:executable set to
*
|
| Line | |
|---|
| 1 | #!/usr/bin/env gosh |
|---|
| 2 | ;; |
|---|
| 3 | ;; index.cgi - listing logs |
|---|
| 4 | ;; |
|---|
| 5 | (require "../setting") |
|---|
| 6 | |
|---|
| 7 | (sys-chdir log-dir) |
|---|
| 8 | |
|---|
| 9 | (display "Content-type: text/html\r\n\r\n") |
|---|
| 10 | (print "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" |
|---|
| 11 | \"http://www.w3.org/TR/html4/loose.dtd\"> |
|---|
| 12 | <html> |
|---|
| 13 | <head> |
|---|
| 14 | <title>" irc-channel "</title> |
|---|
| 15 | <link rel=\"stylesheet\" href=\"wiliki.css\" type=\"text/css\" /> |
|---|
| 16 | <link rel=\"alternate\" type=\"application/rss+xml\" title=\"RSS\" href=\"/" rdf-name "\" /> |
|---|
| 17 | </head> |
|---|
| 18 | <body> |
|---|
| 19 | <h1>" irc-channel " IRC logs</h1> |
|---|
| 20 | |
|---|
| 21 | <hr /> |
|---|
| 22 | <ul> |
|---|
| 23 | " |
|---|
| 24 | |
|---|
| 25 | (string-join (map (lambda (path) |
|---|
| 26 | (let1 date-str (regexp-replace #/\.log$/ path "") |
|---|
| 27 | #`"<li><a href=\"logview.cgi?,|date-str|\">,|date-str|</a></li>\n")) |
|---|
| 28 | (reverse! (sort! (glob "20[0-9][0-9]-[01][0-9]-[0-3][0-9].log")))) "") |
|---|
| 29 | |
|---|
| 30 | "</ul> |
|---|
| 31 | <hr /> |
|---|
| 32 | |
|---|
| 33 | </body> |
|---|
| 34 | </html>") |
|---|