summaryrefslogtreecommitdiffstats
path: root/emacsconf.el
diff options
context:
space:
mode:
authorSacha Chua <sacha@sachachua.com>2024-11-20 18:37:45 -0500
committerSacha Chua <sacha@sachachua.com>2024-11-20 18:37:45 -0500
commit174e3d26cf23dc9da3ea77926cbdf43561de4ba5 (patch)
tree6c5dd7414819b05377a85918d19f7e93ab0cdddc /emacsconf.el
parenta1745f10a19bfdafe5f9543fe80dbd8621cadcaa (diff)
downloademacsconf-el-174e3d26cf23dc9da3ea77926cbdf43561de4ba5.tar.xz
emacsconf-el-174e3d26cf23dc9da3ea77926cbdf43561de4ba5.zip
load-roomsHEADmain
Diffstat (limited to 'emacsconf.el')
-rw-r--r--emacsconf.el33
1 files changed, 33 insertions, 0 deletions
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 "")))