~technomancy/fennel-lang.org

87acabaa7ddd6fb4b67506d53c2f4b1dfc7fe4b4 — Phil Hagelberg 3 months ago a2d53f7
A few more survey tweaks.
2 files changed, 7 insertions(+), 3 deletions(-)

M survey/Makefile
M survey/save.fnl
M survey/Makefile => survey/Makefile +6 -2
@@ 1,5 1,5 @@
OUT=index.html save.cgi thanks.html 2021.html 2022.html 2023.html save.cgi
YEAR=2024
YEAR=2024 # also edit save.fnl and mkdir responses/$YEAR
html: $(OUT)

upload: $(OUT)


@@ 17,8 17,12 @@ index.html: survey.fnl questions-$(YEAR).fnl
2023.html: summary.fnl chart.fnl questions-2023.fnl commentary/2023/* responses/2023/*
	../fennel/fennel --add-fennel-path "../?.fnl" $< 2023 > $@

2024.html: summary.fnl chart.fnl questions-2024.fnl commentary/2024/* responses/2024/*
	../fennel/fennel --add-fennel-path "../?.fnl" $< 2024 > $@


save.cgi: save.fnl
	echo "#!/usr/bin/env lua" > $@
	echo "#!/home/fenneler/lua" > $@
	../fennel/fennel --compile $< >> $@
	chmod 755 $@


M survey/save.fnl => survey/save.fnl +1 -1
@@ 1,7 1,7 @@
;; This is the only piece of code which runs server-side.
;; It takes HTTP POST data on stdin and saves it to disk for later analysis.

(let [year 2023
(let [year 2024
      contents (io.read "*all")
      ;; we could use os.time but it only has second-level resolution which
      ;; means there is a very slight chance of conflict for two requests.