]> git.deb.at Git - debienna.git/blob - LefantFotoHack/index.mdwn
convert Self: links
[debienna.git] / LefantFotoHack / index.mdwn
1 {{{
2 #!/usr/bin/scsh -s
3 !#
4
5 (define r-s regexp-substitute/global)
6
7 ;;; to be executed in a directory with dirindex.html
8 ;;; will echo moin markup to stdout
9 (display
10  (let ((file-contents
11         (call-with-input-file "dirindex.html"
12           (lambda (in) 
13             (read-string (file-size "dirindex.html") in))))
14        (curdir
15         (r-s #f
16              (rx (: "public_html/fotos/"
17                     (submatch (: (= 4 numeric)
18                                  "/debianistas/"
19                                  (= 4 numeric) "_"
20                                  (= 2 numeric) "_"
21                                  (= 2 numeric)))))
22              (run/string (pwd))
23              1 "/")))
24    (r-s #f
25         (rx (: "<a href=\""
26                (submatch (: "cimg" (= 4 numeric) ".html"))
27                "\">"
28                #\newline
29                "<img src=\""
30                (submatch (: "cimg" (= 4 numeric) "--thumb.jpg"))
31                "\" width="))
32         file-contents
33         'pre 'post
34         "[http://fotos.lefant.net/" curdir 1
35         " http://fotos.lefant.net/" curdir 2 "]\n")))
36
37 (newline)
38 }}}
39
40 ----
41 CategoryCodeSnippets