diff options
Diffstat (limited to '')
-rw-r--r-- | emacsconf-erc.el | 313 | ||||
-rw-r--r-- | emacsconf.el | 184 |
2 files changed, 330 insertions, 167 deletions
diff --git a/emacsconf-erc.el b/emacsconf-erc.el index e6e3c58..2f2fd94 100644 --- a/emacsconf-erc.el +++ b/emacsconf-erc.el @@ -19,13 +19,34 @@ ;; along with this program. If not, see <https://www.gnu.org/licenses/>. ;;; Commentary: - -;; - /announce slug +;; +;; Goals: +;; - Announce talks and Q&A sessions +;; - Change talk status and trigger hooks +;; +;; Commands: +;; +;; announcements only +;; - /nowplaying slug +;; - /nowclosedq slug +;; - /nowopenq slug +;; - /nowunstreamedq slug +;; - /nowdone slug + +;; use M-x emacsconf-erc-add-to-todo-hook in conf.org to have the announcements triggered by todo state changes +;; +;; updating task status +;; - /markplaying slug +;; - /markclosedq slug +;; - /markopenq slug +;; - /markunstreamedq slug +;; - /markdone slug +;; +;; general ;; - /broadcast message ;; - /conftopic message -;; - /checkin ROOM nick -;; - /ready ROOM slug - +;; - /checkin nick +;; ;;; Code: (defcustom emacsconf-collaborative-pad @@ -38,8 +59,13 @@ :group 'emacsconf :type 'string) +(defcustom emacsconf-erc-hallway "#emacsconf" "Channel for hallway conversations") +(defcustom emacsconf-erc-org "#emacsconf-org" "Channel for organizers") + (defcustom emacsconf-topic-templates - '(("#emacsconf" "EmacsConf 2022 | Subscribe to https://lists.gnu.org/mailman/listinfo/emacsconf-discuss for updates") + '(("#emacsconf" "${emacsconf-name} ${year} | Subscribe to https://lists.gnu.org/mailman/listinfo/emacsconf-discuss for updates") + ("#emacsconf-gen" "General track | https://emacsconf.org/2022/watch/gen/ | Subscribe to https://lists.gnu.org/mailman/listinfo/emacsconf-discuss for updates") + ("#emacsconf-dev" "Development track | https://emacsconf.org/2022/watch/dev/ | Subscribe to https://lists.gnu.org/mailman/listinfo/emacsconf-discuss for updates") ("#emacsconf-accessible" "EmacsConf 2022 accessibility - help by describing what's happening | Subscribe to https://lists.gnu.org/mailman/listinfo/emacsconf-discuss for updates") ("#emacsconf-org" "EmacsConf 2022 | Dedicated channel for EmacsConf organizers and speakers | this is intended as an internal, low-traffic channel; for main discussion around EmacsConf, please join #emacsconf | Subscribe to https://lists.gnu.org/mailman/listinfo/emacsconf-discuss for updates") ("#emacsconf-questions" "EmacsConf 2022 | Low-traffic channel for questions if speakers prefer IRC and need help focusing; for main discussion around EmacsConf, please join #emacsconf | Subscribe to https://lists.gnu.org/mailman/listinfo/emacsconf-discuss for updates")) @@ -50,125 +76,230 @@ ;; For testing: (setq emacsconf-topic-templates '(("#emacsconf-test" "EmacsConf 2022 | Dedicated channel for EmacsConf organizers and speakers | this is intended as an internal, low-traffic channel; for main discussion around EmacsConf, please join #emacsconf | Subscribe to https://lists.gnu.org/mailman/listinfo/emacsconf-discuss for updates"))) -(defcustom emacsconf-rooms - '(("A" "http://example.org?room=a") - ("B" "http://example.org?room=b") - ("C" "http://example.org?room=c")) - "Room IDs and URLs." - :group 'emacsconf - :type '(repeat (list (string :tag "ID") - (string :tag "URL")))) - (defmacro emacsconf-erc-with-channels (channel-list &rest forms) (declare (indent 1) (debug (form form body))) `(mapcar (lambda (channel) + (unless (erc-get-buffer channel) + (erc-join-channel channel)) (with-current-buffer (erc-get-buffer channel) ,@forms)) ,channel-list)) -(defun emacsconf-get-room (room) - (cadr (assoc (upcase room) emacsconf-rooms))) - (defun erc-cmd-CONFTOPIC (&rest message) "Set the topic to MESSAGE | template in the EmacsConf channels. - If MESSAGE is not specified, reset the topic to the template." +If MESSAGE is not specified, reset the topic to the template." (mapc (lambda (template) (with-current-buffer (erc-get-buffer (car template)) (erc-cmd-TOPIC (if message (concat (if (stringp message) message (s-join " " message)) " | " (cadr template)) (cadr template))))) emacsconf-topic-templates)) -(defun erc-cmd-CHECKIN (nick &optional q-and-a) - (let ((talk (emacsconf-complete-talk)) - info) +(defun erc-cmd-CHECKIN (nick) + (let* ((talk (emacsconf-complete-talk-info)) + (q-and-a (plist-get talk :q-and-a) "")) (save-excursion - (emacsconf-with-talk-heading talk + (emacsconf-with-talk-heading (plist-get talk :slug) (org-entry-put (point) "IRC" nick) - (org-entry-put (point) "CHECK_IN" (format-time-string "%H:%M")) - (setq info (emacsconf-get-talk-info-for-subtree)))) - (setq q-and-a (or q-and-a (plist-get info :q-and-a) "")) + (org-entry-put (point) "CHECK_IN" (format-time-string "%H:%M")))) (cond ((string-match "live" q-and-a) (erc-send-message (format "%s: Thanks for checking in! I'll send you some private messages with instructions, so please check there. Let me know if you don't get them." nick)) - (erc-cmd-BBB (completing-read "Room: " emacsconf-rooms) nick talk)) + (erc-cmd-ROOM nick talk)) ((string-match "pad" q-and-a) - (erc-send-message (format "%s: Thanks for checking in! The collaborative pad we'll be using for questions is at %s . We'll collect questions from #emacsconf and put them there. If you'd like to jump to your part of the document, you might be able to keep an eye on questions. Please let us know if you need help, or if you want to switch to live Q&A." nick emacsconf-collaborative-pad))) + (erc-send-message (format "%s: Thanks for checking in! The collaborative pad we'll be using for questions is at %s . We'll collect questions and put them there. If you'd like to open it, you can keep an eye on questions. Please let us know if you need help, or if you want to switch to live Q&A." nick (plist-get talk :pad-url)))) ((string-match "IRC" q-and-a) - (erc-send-message (format "%s: Thanks for checking in! Feel free to keep an eye on #emacsconf for questions and discussion, and we'll copy things from the pad to there. If the volume gets overwhelming, let us know and we can forward questions to #emacsconf-questions for you. If you'd like to try Q&A over live video or the collaborative pad instead, or if you need help, please let us know." nick emacsconf-collaborative-pad))) - (t (erc-send-message (format "%s: Thanks for checking in! How would you like to handle Q&A today - live video, the collaborative Etherpad at %s , or IRC (like this)?" nick emacsconf-collaborative-pad)))) - (emacsconf-with-talk-heading talk - (emacsconf-upcoming-insert-or-update nil t)))) - -(defun erc-cmd-BBB (room nick &optional talk) - "Send instructions for ROOM and `conf-collaborative-pad' to NICK." - (let ((room-url (emacsconf-get-room room))) - (unless room-url (error "Please specify nick and room name")) - (erc-message "PRIVMSG" (format "%s You can use this BBB room: %s . I'll join you there shortly to set up the room and do the last-minute tech check." nick room-url)) - (erc-message "PRIVMSG" (format "%s The collaborative pad we'll be using for questions is at %s . We'll collect questions from #emacsconf and put them there. If you'd like to jump to your part of the document, you might be able to keep an eye on questions. Alternatively, we can read questions to you." nick emacsconf-collaborative-pad)) - (erc-message "PRIVMSG" (format "%s The host will join and give you the go-ahead when it's time to present. See you in the BBB room!" nick)) - (setq talk (or talk (emacsconf-complete-talk))) - (emacsconf-with-talk-heading talk - (let ((talk-info (emacsconf-get-talk-info-for-subtree))) - (org-entry-put (point) "BBB_ROOM" room-url) - (when emacsconf-tasks-file - (with-current-buffer (find-file-noselect emacsconf-tasks-file) - (goto-char (point-min)) - (insert (emacsconf-replace-plist-in-string - (append info (list :current-time (format-time-string "[%Y-%m-%d %a %H:%M]"))) - "* WAITING [#A] Check in ${nick} (${speakers}) for %s at %s -:PROPERTIES: -:CREATED: ${current-time} -:END: -[[file:~/vendor/emacsconf-wiki/playbook.org::#check-in][file:~/vendor/emacsconf-wiki/playbook.org::#check-in]] - -")))))))) - -(defun erc-cmd-READY (code &rest filter) - "Notify #emacsconf-org and `conf-streaming-nick' that CODE is ready for the talk specified by FILTER. -FILTER can be the talk ID or strings to match against the title or speaker names." - (let ((room-url (emacsconf-get-room code)) - (talk (emacsconf-find-talk-info filter)) + (erc-send-message (format "%s: Thanks for checking in! Feel free to keep an eye on %s for questions and discussion, and we'll copy things from the pad to there. If the volume gets overwhelming, let us know and we can /msg you questions or add them to the pad. If you'd like to try Q&A over live video or the collaborative pad instead, or if you need help, please let us know." nick + (plist-get (emacsconf-get-track (plist-get talk :track)) :channel)))) + (t (erc-send-message (format "%s: Thanks for checking in! How would you like to handle Q&A today - live video, the collaborative Etherpad at %s , or IRC (like this)?" nick (plist-get) emacsconf-collaborative-pad)))) + (when (functionp 'emacsconf-upcoming-insert-or-update) + (emacsconf-with-talk-heading (plist-get talk :slug) + (emacsconf-upcoming-insert-or-update nil t))))) + +(defun erc-cmd-BBB (nick &optional talk) + "Send live Q&A instructions to NICK." + (setq talk (or talk (emacsconf-complete-talk-info))) + (erc-message "PRIVMSG" (format "%s You can use this BBB room: %s . We'll join you there shortly to set up the room and do the last-minute tech check." nick (plist-get talk :bbb-room))) + (erc-message "PRIVMSG" (format "%s The collaborative pad we'll be using for questions is at %s . We'll collect questions from #emacsconf and put them there. If you'd like to jump to your part of the document, you might be able to keep an eye on questions. Alternatively, we can read questions to you." nick (plist-get talk :pad-url))) + (erc-message "PRIVMSG" (format "%s The host will join and give you the go-ahead when you go on air. See you in the BBB room!" nick))) + +(defun erc-cmd-READY (&rest filter) + "Notify #emacsconf-org and `emacsconf-streaming-nick' that the speaker is ready." + (let ((talk (emacsconf-find-talk-info filter)) pronouns pronunciation) - (unless room-url (error "Could not find room")) (unless talk (error "Could not find talk")) - (emacsconf-with-talk-heading (plist-get talk :slug) - (setq pronouns (org-entry-get (point) "PRONOUNS") - pronunciation (org-entry-get (point) "PRONUNCIATION"))) - (with-current-buffer (erc-get-buffer "#emacsconf-org") - (erc-send-message (format "Ready in Room %s: %s (%s)" - (upcase code) - (plist-get talk :title) - (plist-get talk :speakers)))) + (setq pronouns (plist-get talk :pronouns) + pronunciation (plist-get talk :pronunciation)) + (emacsconf-erc-with-channels (list emacsconf-erc-org) + (erc-send-message (format "Ready: %s (%s)" (plist-get talk :title) (plist-get talk :speakers)))) (mapc (lambda (nick) (erc-message "PRIVMSG" - (format "%s Ready in Room %s ( %s ): %s (%s) %s %s" + (format "%s ready in %s: %s (%s) %s %s" emacsconf-nick - (upcase code) - room-url + (plist-get talk :bbb-room) (plist-get talk :title) (plist-get talk :speakers) (or pronouns "") (or pronunciation "")))) (if (listp emacsconf-streaming-nick) emacsconf-streaming-nick (list emacsconf-streaming-nick))))) +;;; Announcements + +(defun erc-cmd-NOWPLAYING (talk) + "Set the channel topics to announce TALK." + (interactive (list (emacsconf-complete-talk-info))) + (when (stringp talk) (setq talk (or (emacsconf-find-talk-info talk) (error "Could not find talk %s" talk)))) + ;; Announce it in the track's channel + (when (plist-get talk :track) + (emacsconf-erc-with-channels (list (plist-get talk :channel)) + (erc-cmd-TOPIC (format "%s: %s (%s) pad: %s Q&A: %s | %s" + (plist-get talk :slug) + (plist-get talk :title) + (plist-get talk :speakers) + (plist-get talk :pad-url) + (plist-get talk :qa-info) + (car (assoc-default (plist-get talk :channel) emacsconf-topic-templates)))) + (erc-send-message (format "---- %s: %s (%s) ----" + (plist-get talk :slug) + (plist-get talk :title) + (string-join + (delq nil + (list (plist-get talk :speakers) + (plist-get talk :pronouns))) + "; "))) + (erc-send-message (concat "Add your notes/questions to the pad: " (plist-get talk :pad-url))) + (cond + ((string-match "live" (or (plist-get talk :q-and-a) "")) + (erc-send-message (concat "Live Q&A: " (plist-get talk :bbb-redirect)))) + ((plist-get talk :irc) + (erc-send-message "or discuss the talk on IRC (nick: %s)"))))) + ;; Short announcement in #emacsconf + (emacsconf-erc-with-channels (list emacsconf-erc-hallway emacsconf-erc-org) + (erc-send-message (format "-- %s track: %s: %s (watch: %s, pad: %s, channel: %s)" + (plist-get talk :track) + (plist-get talk :slug) + (plist-get talk :title) + (plist-get talk :watch-url) + (plist-get talk :pad-url) + (plist-get talk :channel))))) + +(defun erc-cmd-NOWCLOSEDQ (talk) + "Announce TALK has started Q&A, but the host has not yet opened it up." + (interactive (list (emacsconf-complete-talk-info))) + (when (stringp talk) (setq talk (or (emacsconf-find-talk-info talk) (error "Could not find talk %s" talk)))) + (emacsconf-erc-with-channels (list (plist-get talk :channel)) + (erc-send-message (format "-- Q&A beginning for \"%s\" (%s) Watch: %s Add notes/questions: %s" + (plist-get talk :title) + (plist-get talk :qa-info) + (plist-get talk :watch-url) + (plist-get talk :pad-url)))) + (emacsconf-erc-with-channels (list emacsconf-erc-hallway emacsconf-erc-org) + (erc-send-message (format "-- Q&A beginning for \"%s\" in the %s track (%s) Watch: %s Add notes/questions: %s . Chat: %s" + (plist-get talk :title) + (plist-get talk :track) + (plist-get talk :qa-info) + (plist-get talk :watch-url) + (plist-get talk :pad-url) + (plist-get talk :channel))))) + +(defun erc-cmd-NOWOPENQ (talk) + (interactive (list (emacsconf-complete-talk-info))) + (when (stringp talk) (setq talk (or (emacsconf-find-talk-info talk) (error "Could not find talk %s" talk)))) + (emacsconf-erc-with-channels (list (plist-get talk :channel)) + (erc-send-message (format "-- Q&A now open for \"%s\" (%s). Watch: %s Add notes/questions: %s ." + (plist-get talk :title) + (plist-get talk :qa-info) + (plist-get talk :watch-url) + (plist-get talk :pad-url)))) + (emacsconf-erc-with-channels (list emacsconf-erc-hallway emacsconf-erc-org) + (erc-send-message (format "-- Q&A now open for \"%s\" in the %s track (%s). Watch: %s Add notes/questions: %s IRC: %s" + (plist-get talk :title) + (plist-get talk :track) + (plist-get talk :qa-info) + (plist-get talk :watch-url) + (plist-get talk :pad-url) + (plist-get talk :channel))))) + +(defun erc-cmd-NOWUNSTREAMEDQ (talk) + (interactive (list (emacsconf-complete-talk-info))) + (when (stringp talk) (setq talk (or (emacsconf-find-talk-info talk) (error "Could not find talk %s" talk)))) + (emacsconf-erc-with-channels (list (plist-get talk :channel)) + (erc-send-message (format "-- Q&A continues off-stream for \"%s\" (%s) Add notes/questions: %s ." + (plist-get talk :title) + (plist-get talk :qa-info) + (plist-get talk :pad-url)))) + (emacsconf-erc-with-channels (list emacsconf-erc-hallway emacsconf-erc-org) + (erc-send-message (format "-- Q&A continues off-stream for \"%s\" in the %s track (%s) Add notes/questions: %s IRC: %s" + (plist-get talk :title) + (plist-get talk :track) + (plist-get talk :qa-info) + (plist-get talk :pad-url) + (plist-get talk :channel))))) + +(defun erc-cmd-NOWDONE (talk) + (interactive (list (emacsconf-complete-talk-info))) + (when (stringp talk) (setq talk (or (emacsconf-find-talk-info talk) (error "Could not find talk %s" talk)))) + (emacsconf-erc-with-channels (list (plist-get talk :channel)) + (erc-send-message (format "-- Q&A finished for \"%s\". Add notes/questions: %s %s" + (plist-get talk :title) + (plist-get talk :pad-url) + (emacsconf-surround " Speaker IRC nick: " (plist-get talk :irc) "" "")))) + (emacsconf-erc-with-channels (list emacsconf-erc-hallway emacsconf-erc-org) + (erc-send-message (format "-- Q&A finished for \"%s\" in the %s track. Add notes/questions: %s %s" + (plist-get talk :title) + (plist-get talk :track) + (plist-get talk :pad-url) + (emacsconf-surround " Speaker IRC nick: " (plist-get talk :irc) "" ""))))) + +;;; For todo hooks + +(defun emacsconf-erc-add-to-todo-hook () + (interactive) + (add-hook 'org-after-todo-state-change-hook #'emacsconf-erc-org-after-todo-state-change nil t)) +(defun emacsconf-erc-remove-from-todo-hook () + (interactive) + (remove-hook 'org-after-todo-state-change-hook #'emacsconf-erc-org-after-todo-state-change t)) + +(defun emacsconf-erc-org-after-todo-state-change () + (let ((func + (pcase org-state + ("PLAYING" #'erc-cmd-NOWPLAYING) + ("CLOSED_Q" #'erc-cmd-NOWCLOSEDQ) + ("OPEN_Q" #'erc-cmd-NOWOPENQ) + ("UNSTREAMED_Q" #'erc-cmd-NOWUNSTREAMEDQ) + ("TO_ARCHIVE" #'erc-cmd-NOWDONE)))) + (when func + (funcall func (emacsconf-get-talk-info-for-subtree))))) + +;;; Change TODO states +(defun erc-cmd-MARKPLAYING (talk) + "Mark TALK as starting streaming." + (interactive (list (emacsconf-complete-talk-info))) + (when (stringp talk) (setq talk (emacsconf-find-talk-info talk))) + (save-window-excursion + (emacsconf-with-talk-heading talk (org-todo "PLAYING")))) + +(defun erc-cmd-MARKCLOSEDQ (talk) + "Mark TALK as starting closed Q&A." + (interactive (list (emacsconf-complete-talk-info))) + (when (stringp talk) (setq talk (emacsconf-find-talk-info talk))) + (save-window-excursion + (emacsconf-with-talk-heading talk (org-todo "CLOSED_Q")))) + +(defun erc-cmd-MARKOPENQ (talk) + "Mark TALK as starting open Q&A." + (interactive (list (emacsconf-complete-talk-info))) + (when (stringp talk) (setq talk (emacsconf-find-talk-info talk))) + (save-window-excursion + (emacsconf-with-talk-heading talk (org-todo "OPEN_Q")))) + +(defun erc-cmd-MARKDONE (talk) + "Mark TALK as done with the streaming and Q&A" + (interactive (list (emacsconf-complete-talk-info))) + (when (stringp talk) (setq talk (emacsconf-find-talk-info talk))) + (save-window-excursion + (emacsconf-with-talk-heading talk (org-todo "TO_ARCHIVE")))) -(defun erc-cmd-ANNOUNCE (filter) - "Set the channel topics to announce the talk specified by FILTER. - FILTER can be the talk ID or strings to match against the title or speaker names." - (let ((info - (if (listp filter) - (car filter) - (emacsconf-find-talk-info filter)))) - (unless info (error "Could not find talk.")) - (erc-cmd-CONFTOPIC (format "%s: %s (%s)" - (plist-get info :slug) - (plist-get info :title) - (plist-get info :speakers))) - (erc-cmd-BROADCAST (format "---- %s (%s, https://emacsconf.org/%s/talks/%s) ----" - (plist-get info :title) - (plist-get info :speakers) - emacsconf-year - (plist-get info :slug))))) +;;; Other commands (defun erc-cmd-OPALL () (emacsconf-erc-with-channels (mapcar 'car emacsconf-topic-templates) diff --git a/emacsconf.el b/emacsconf.el index 112281a..8183fc5 100644 --- a/emacsconf.el +++ b/emacsconf.el @@ -58,7 +58,7 @@ "Controls what information to include. 'program - don't include times 'schedule - include times; use this leading up to the emacsconference -'resources - after the emacsconference, don't need status" +'resources - after EmacsConf, don't need status" :group 'emacsconf :type '(choice (const :tag "Program: Don't include times" program) @@ -168,20 +168,25 @@ (interactive (list (emacsconf-complete-talk))) (pop-to-buffer (find-file-noselect emacsconf-org-file)) (widen) - (if (emacsconf-get-slug-from-string search) - (goto-char (org-find-property "SLUG" (emacsconf-get-slug-from-string search))) - (catch 'found - (org-map-entries - (lambda () - (when (string-match search - (cons - (concat (org-entry-get (point) "SLUG") " - " - (org-entry-get (point) "ITEM") " - " - (org-entry-get (point) "NAME") " - " - (org-entry-get (point) "EMAIL")) - (point))) - (throw 'found (point)))) - "SLUG={.}"))) + (cond + ((plist-get search :slug) + (goto-char (org-find-property "SLUG" (plist-get search :slug)))) + ((emacsconf-get-slug-from-string search) + (goto-char (org-find-property "SLUG" (emacsconf-get-slug-from-string search)))) + (t + (goto-char + (catch 'found + (org-map-entries + (lambda () + (when (string-match search + (cons + (concat (org-entry-get (point) "SLUG") " - " + (org-entry-get (point) "ITEM") " - " + (org-entry-get (point) "NAME") " - " + (org-entry-get (point) "EMAIL")) + (point))) + (throw 'found (point)))) + "SLUG={.}"))))) (org-reveal)) (defmacro emacsconf-for-each-talk (&rest body) @@ -219,75 +224,85 @@ (defun emacsconf-get-talk-info-from-properties (o) (let ((heading (org-heading-components)) - (field-props '((:title "ITEM") - (:talk-id "TALK_ID") + (field-props '( + ;; Initial creation + (:title "ITEM") (:track "TRACK") (:slug "SLUG") - (:video-slug "VIDEO_SLUG") - (:qa-public "QA_PUBLIC") ; now tracked by the OPEN_Q and UNSTREAMED_Q status - (:scheduled "SCHEDULED") - (:uuid "UUID") + (:speakers "NAME") + (:speakers-short "NAME_SHORT") (:email "EMAIL") - (:caption-note "CAPTION_NOTE") + (:public-email "PUBLIC_EMAIL") + (:emergency "EMERGENCY") + (:buffer "BUFFER") + (:duration "TIME") + (:min-time "MIN_TIME") + (:max-time "MAX_TIME") (:availability "AVAILABILITY") - (:timezone "TIMEZONE") (:q-and-a "Q_AND_A") - (:bbb-room "ROOM") + (:timezone "TIMEZONE") (:irc "IRC") + (:pronunciation "PRONUNCIATION") + (:pronouns "PRONOUNS") + ;; Scheduling + (:scheduled "SCHEDULED") + (:time "TIME") + (:fixed-time "FIXED_TIME") + ;; Coordination + (:prerec-info "PREREC_INFO") + ;; Prep + (:bbb-room "ROOM") + ;; Processing + (:video-slug "VIDEO_SLUG") + (:video-file "VIDEO_FILE") + (:video-file-size "VIDEO_FILE_SIZE") + (:video-duration "VIDEO_DURATION") + (:youtube-url "YOUTUBE_URL") + (:toobnix-url "TOOBNIX_URL") + ;; Captioning + (:captioner "CAPTIONER") + (:caption-note "CAPTION_NOTE") (:intro-note "INTRO_NOTE") - (:public "PUBLIC") + ;; Conference (:check-in "CHECK_IN") - (:contact "CONTACT") - (:captioner "CAPTIONER") - (:youtube-url "YOUTUBE_URL") - (:toobnix-url "TOOBNIX_URL") + (:public "PUBLIC") + ;; Extraction (:qa-youtube "QA_YOUTUBE") (:qa-toobnix "QA_TOOBNIX") - (:pronunciation "PRONUNCIATION") - (:pronouns "PRONOUNS") - (:prerec-info "PREREC_INFO") - (:public-email "PUBLIC_EMAIL") - (:buffer "BUFFER") - (:duration "TIME") - (:time "TIME") - (:min-time "MIN_TIME") - (:max-time "MAX_TIME") - (:fixed-time "FIXED_TIME") + ;; Old + (:alternate-apac "ALTERNATE_APAC") + (:extra-live-time "EXTRA_LIVE_TIME") (:present "PRESENT") - (:speakers "NAME") - (:speakers-short "NAME_SHORT") - (:video-file "VIDEO_FILE") - (:video-file-size "VIDEO_FILE_SIZE") - (:video-duration "VIDEO_DURATION") - (:alternate-apac "ALTERNATE_APAC") - (:extra-live-time "EXTRA_LIVE_TIME")))) + (:talk-id "TALK_ID") ; use slug instead + (:qa-public "QA_PUBLIC") ; now tracked by the OPEN_Q and UNSTREAMED_Q status + (:uuid "UUID") ; Pentabarf export + ))) (apply 'append o (list :point (point) :year emacsconf-year + :conf-year emacsconf-year :type (if (org-entry-get (point) "SLUG") 'talk 'headline) :status (elt heading 2) :level (car heading) :url (concat emacsconf-year "/talks/" (org-entry-get (point) "SLUG")) - :schedule-group - (org-entry-get-with-inheritance "SCHEDULE_GROUP") - :wiki-file-path (expand-file-name - (concat (org-entry-get (point) "SLUG") ".md") - (expand-file-name "captions" (expand-file-name emacsconf-year emacsconf-directory))) - :conf-year emacsconf-year - :bbb-redirect (format "https://emacsconf.org/current/%s/room/" (org-entry-get (point) "SLUG")) - :pad-url (format "https://pad.emacsconf.org/%s-%s" emacsconf-year (org-entry-get (point) "SLUG")) - :start-time (when (org-entry-get (point) "SCHEDULED") - (date-to-time - (concat - (format-time-string "%Y-%m-%dT%H:%M:%S" - (org-timestamp-to-time - (org-timestamp-split-range - (org-timestamp-from-string - (org-entry-get (point) "SCHEDULED"))))) - emacsconf-timezone-offset))) + :schedule-group (org-entry-get-with-inheritance "SCHEDULE_GROUP") + :wiki-file-path + (expand-file-name + (concat (org-entry-get (point) "SLUG") ".md") + (expand-file-name "captions" (expand-file-name emacsconf-year emacsconf-directory))) + :start-time + (when (org-entry-get (point) "SCHEDULED") + (date-to-time + (concat + (format-time-string "%Y-%m-%dT%H:%M:%S" + (org-timestamp-to-time + (org-timestamp-split-range + (org-timestamp-from-string + (org-entry-get (point) "SCHEDULED"))))) + emacsconf-timezone-offset))) :end-time (when (org-entry-get (point) "SCHEDULED") (date-to-time (concat @@ -399,23 +414,40 @@ emacsconf-get-talk-categories emacsconf-get-talk-abstract-from-subtree emacsconf-add-talk-status - emacsconf-add-timezone-conversions)) + emacsconf-add-timezone-conversions + emacsconf-add-live-info)) + +(defun emacsconf-add-live-info (o) + (let ((track (emacsconf-get-track (plist-get o :track)))) + (when track + (plist-put o :watch-url (concat emacsconf-base-url emacsconf-year "/watch/" (plist-get track :id)))) + (plist-put o :channel (plist-get track :channel)) + (cond + ((string-match "live" (or (plist-get o :q-and-a) "")) + (plist-put o :bbb-redirect (format "https://emacsconf.org/current/%s/room/" (plist-get o :slug))) + (plist-put o :qa-info (plist-get o :bbb-redirect))) + ((string-match "IRC" (or (plist-get o :q-and-a) "")) + (plist-put o :qa-info (concat (emacsconf-surround "nick: " (plist-get o :irc) ", " "") + (plist-get o :channel)))) + (t (plist-put o :qa-info "none"))) + (plist-put o :pad-url (format "https://pad.emacsconf.org/%s-%s" emacsconf-year (plist-get o :slug))) + o)) (defun emacsconf-search-talk-info (search &optional info) (setq info (or info (emacsconf-get-talk-info))) (or (seq-find (lambda (o) (string= (plist-get o :slug) - (emacsconf-get-slug-from-string search))) - info) + (emacsconf-get-slug-from-string search))) + info) (seq-find (lambda (o) - (string-match - search - (format "%s - %s - %s - %s" - (plist-get o :slug) - (plist-get o :title) - (plist-get o :speakers) - (plist-get o :email)))) - info))) + (string-match + search + (format "%s - %s - %s - %s" + (plist-get o :slug) + (plist-get o :title) + (plist-get o :speakers) + (plist-get o :email)))) + info))) (defun emacsconf-get-talk-info-for-subtree () (seq-reduce (lambda (prev val) (save-excursion (save-restriction (funcall val prev)))) @@ -774,8 +806,8 @@ (emacsconf-pad-base . etherpad_url)))))) ;; (emacsconf-ansible-load-vars (expand-file-name "prod-vars.yml" emacsconf-ansible-directory)) ;;; Tracks -(defvar emacsconf-tracks '((:name "General" :color "peachpuff" :id "gen") - (:name "Development" :color "skyblue" :id "dev"))) +(defvar emacsconf-tracks '((:name "General" :color "peachpuff" :id "gen" :channel "emacsconf-gen") + (:name "Development" :color "skyblue" :id "dev" :channel "emacsconf-dev"))) (defun emacsconf-get-track (name) (seq-find (lambda (track) (or (string= name (plist-get track :name)) |