From 174e3d26cf23dc9da3ea77926cbdf43561de4ba5 Mon Sep 17 00:00:00 2001 From: Sacha Chua Date: Wed, 20 Nov 2024 18:37:45 -0500 Subject: load-rooms --- emacsconf.el | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'emacsconf.el') diff --git a/emacsconf.el b/emacsconf.el index e57e7b3..024c176 100644 --- a/emacsconf.el +++ b/emacsconf.el @@ -1598,6 +1598,39 @@ Filter by TRACK if given. Use INFO as the list of talks." (seq-group-by (lambda (o) (plist-get o :speakers)) (or info (emacsconf-active-talks (emacsconf-filter-talks (emacsconf-get-talk-info)))))))) +(defun emacsconf-load-rooms (string) + "Split STRING and load them as ROOM properties. +STRING should be a list of rooms, one room per line, like this: +friendly-id speaker - slugs +friendly-id speaker - slugs +" + (let ((rooms + (mapcar (lambda (row) (when (string-match "^\\(.+?\\) \\(.+\\)" row) + (list (match-string 1 row) (match-string 2 row)))) + (split-string string "\n")))) + (mapc (lambda (talk) + (emacsconf-go-to-talk talk) + (when (plist-get talk :speakers) + (org-entry-put + (point) + "ROOM" + (concat + emacsconf-bbb-base-url + "rooms/" + (car + (seq-find + (lambda (o) + (string-match + (concat + "^" + (regexp-quote + (plist-get talk :speakers)) + " - ") + (cadr o))) + rooms)) + "/join")))) + (emacsconf-active-talks (emacsconf-get-talk-info))))) + (defun emacsconf-surround (before text after &optional alternative) "Concat BEFORE, TEXT, and AFTER if TEXT is specified, or return ALTERNATIVE." (if (and text (not (string= text ""))) -- cgit v1.2.3