diff options
author | Leo Vivier <zaeph@zaeph.net> | 2022-10-23 21:18:14 +0200 |
---|---|---|
committer | Leo Vivier <zaeph@zaeph.net> | 2022-10-23 21:18:14 +0200 |
commit | 510b6931fb7d9dd49186f719331178a67aa7a894 (patch) | |
tree | 4d6f922627c95b534803057cc4ec4004f8a0dbd3 /2022/organizers-notebook | |
parent | 6036f3d66d117ce01a41a697a779b18d0cecd994 (diff) | |
download | emacsconf-wiki-510b6931fb7d9dd49186f719331178a67aa7a894.tar.xz emacsconf-wiki-510b6931fb7d9dd49186f719331178a67aa7a894.zip |
Add stodgy scripts that took way too long to write
Diffstat (limited to '2022/organizers-notebook')
-rw-r--r-- | 2022/organizers-notebook/index.org | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/2022/organizers-notebook/index.org b/2022/organizers-notebook/index.org index b315a95c..14e75392 100644 --- a/2022/organizers-notebook/index.org +++ b/2022/organizers-notebook/index.org @@ -3787,8 +3787,48 @@ while true; do _sleep done #+end_src +*** Fetch upload data +#+begin_src sh :eval no :tangle prerecs-fetch-upload-data.sh +#!/usr/bin/env sh + +set -eu + +current_time() { + date +"[%T]" +} + +log() { + printf "%s $1\n" "$(current_time)" +} +if [ -t 0 ]; then + log "Fetching data..." +fi +TERM=xterm ssh orga@media.emacsconf.org -- cat /srv/upload/*/*json +#+end_src +*** Fetch new talk data formatted +#+begin_src sh :eval no :tangle prerecs-fetch-new.sh +#!/usr/bin/env sh + +set -eu + +echo "Fetching data..." +data_raw="$(./fetch-upload-data.sh)" + +echo + +echo "$data_raw" | awk "$(cat << EOF +func dewrap(a) {gsub(/^ *".*": "|",$/, "", a); return a}; +BEGIN {i=0}; +/^ "sid"/ { a[0] = dewrap(\$0); }; +/^ "name"/ { a[2] = sprintf("%s\t", dewrap(\$0)) }; +/^ "comment"/ { a[3] = sprintf("%s\t", dewrap(\$0)); if (a[3] == "\t"){a[3] = "No comment"} }; +/^ "key"/ { a[1] = dewrap(\$0); }; +/^\}/ { printf "[%d]\t%s\t%s\t%s\n\t%s\n\n", i, a[0], a[1], a[2], a[3]; i=i+1}; +EOF + )" +#+end_src ** Publish this page #+begin_src emacs-lisp (defun emacsconf-org-publish-this-page () |