summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSacha Chua <sacha@sachachua.com>2026-11-29 20:38:53 -0500
committerSacha Chua <sacha@sachachua.com>2026-11-29 20:38:53 -0500
commit780ad3e2df1ac5153eeecc59870e4901f7aebb6e (patch)
tree59a704b24d458f059006f93abc7024dbe66b934e
parentc47ac67e5acdf73ac835dc73a727edbf6c3d6569 (diff)
downloademacsconf-el-780ad3e2df1ac5153eeecc59870e4901f7aebb6e.tar.xz
emacsconf-el-780ad3e2df1ac5153eeecc59870e4901f7aebb6e.zip
get the environment variables properly
-rw-r--r--emacsconf-bbb.el39
1 files changed, 34 insertions, 5 deletions
diff --git a/emacsconf-bbb.el b/emacsconf-bbb.el
index 95d67f6..0634947 100644
--- a/emacsconf-bbb.el
+++ b/emacsconf-bbb.el
@@ -910,8 +910,8 @@ Strategies:
(defun emacsconf-bbb-request (url)
"Return the DOM for the URL request."
- (let* ((secret (bbb-get-env-or-error "BBB_SECRET"))
- (api-url (bbb-get-env-or-error "BBB_API_URL"))
+ (let* ((secret (getenv "BBB_SECRET"))
+ (api-url (getenv "BBB_API_URL"))
(parts (url-path-and-query
(url-generic-parse-url url)))
(checksum (secure-hash 'sha1 (concat (car parts)
@@ -920,14 +920,43 @@ Strategies:
(full-url (format "%s%s%schecksum=%s" api-url url
(if (string-match "?" url) "&" "?")
checksum))
- (url-automatic-caching nil)
data)
(with-current-buffer (url-retrieve-synchronously full-url)
- ;; Jump past the HTTP response headers to get the body
(goto-char (point-min))
- (re-search-forward "\r?\n\r?\n" nil t)
+ (re-search-forward "^$")
(xml-parse-region (point) (point-max)))))
+(defun emacsconf-bbb-register-recording-hook ()
+ "Register the recording hook."
+ (emacsconf-bbb-request (format "hooks/create?callbackURL=%s&eventID=meeting-recording-started,meeting-recording-stopped,meeting-ended"
+ (url-hexify-string "http://127.0.0.1:8787/bbb-hook"))
+ ))
+
+;;;###autoload
+(defun emacsconf-bbb-meetings ()
+ "Get meeting data."
+ (let ((dom (emacsconf-bbb-request "getMeetings")))
+ (mapcar (lambda (o)
+ `((name . ,(dom-text (dom-by-tag o 'meetingName)))
+ (room-id . ,(dom-text (dom-by-tag o 'bbb-context-id)))
+ (internal-meeting-id . ,(dom-text (dom-by-tag o 'internalMeetingID)))
+ ;; (mod-code . ,(dom-text (dom-by-tag o 'moderatorPW)))
+ (running . ,(dom-text (dom-by-tag o 'running)))
+ (start-time . ,(dom-text (dom-by-tag o 'startTime)))
+ (end-time . ,(dom-text (dom-by-tag o 'endTime)))
+ (participants . ,(dom-text (dom-by-tag o 'participantCount)))
+ (listeners . ,(dom-text (dom-by-tag o 'listenerCount)))
+ (voice . ,(dom-text (dom-by-tag o 'voiceParticipantCount)))
+ (moderators . ,(dom-text (dom-by-tag o 'moderatorCount)))
+ (maxUsers . ,(dom-text (dom-by-tag o 'maxUsers)))
+ (recording . ,(dom-text (dom-by-tag o 'recording)))
+ (attendees . ,(mapcar
+ (lambda (p)
+ (dom-text (dom-by-tag p 'fullName)))
+ (dom-by-tag o 'attendee)))))
+ (dom-by-tag dom 'meeting))))
+
+
;; (emacsconf-bbb-request "getMeetingInfo?meetingID=tiggu7us2zst7o8cs1ozd1mtzhpakmbp4bqlictw")
(defun emacsconf-bbb-update-dashboard ()
"Fetch active BigBlueButton meetings."