From 59333798b0cd7fd285f5e0b3550bb926eab3c38c Mon Sep 17 00:00:00 2001 From: Sacha Chua Date: Tue, 22 Nov 2022 08:34:20 -0500 Subject: generate status page for live.emacsconf.org --- emacsconf-stream.el | 136 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 136 insertions(+) (limited to 'emacsconf-stream.el') diff --git a/emacsconf-stream.el b/emacsconf-stream.el index e2b4962..8fdfcbc 100644 --- a/emacsconf-stream.el +++ b/emacsconf-stream.el @@ -463,5 +463,141 @@ This uses the BBB room if available, or the IRC channel if not." ;; :channel "emacsconf-gen" ;; :qa-info "https://emacsconf.org/current/community/room/") ;; ) + +;; Updates live.emacsconf.org +(defvar emacsconf-stream-live-index "/ssh:orga@front0.emacsconf.org:/var/www/live.emacsconf.org/index.html") + +(defun emacsconf-stream-shift-days () + "Return a label for the conference days." + (let ((start + (date-to-time (car (sort (mapcar (lambda (o) (plist-get o :start)) + emacsconf-shifts) + 'string<)))) + (end + (date-to-time (car (last (sort (mapcar (lambda (o) (plist-get o :end)) + emacsconf-shifts) + 'string<)))))) + (if (string= (format-time-string "%Y-%m-%d" start emacsconf-timezone) + (format-time-string "%Y-%m-%d" end emacsconf-timezone)) + (format-time-string "%A, %b %-d, %Y" + start emacsconf-timezone) + (concat + (format-time-string "%b %-d (%a)" + start emacsconf-timezone) + " to " + (format-time-string "%b %-d (%a), %Y" + end emacsconf-timezone))))) + +(defvar emacsconf-status-timezones '("US/Eastern" "UTC" "Europe/Berlin")) +(defun emacsconf-stream-update-status-page () + (interactive) + (with-temp-file emacsconf-stream-live-index + (insert + (emacsconf-replace-plist-in-string + (list :name emacsconf-name + :year emacsconf-year + :base-url emacsconf-base-url + :days (emacsconf-stream-shift-days) + :timezone-info + (mapconcat (lambda (zone) (concat "" zone "")) + emacsconf-status-timezones "") + :stream-info + (mapconcat + (lambda (track) + (emacsconf-replace-plist-in-string + (append (list :stream-base emacsconf-stream-base) + track) + "${id}${stream-base}${id}.webm +${id}-480p${stream-base}${id}-480p.webm")) + emacsconf-tracks "\n") + :watch-info + (mapconcat + (lambda (track) + (let ((start-time (date-to-time (concat emacsconf-date "T" (plist-get track :start) emacsconf-timezone-offset)))) + (emacsconf-replace-plist-in-string + (append + (list + :time-info + (mapconcat + (lambda (zone) + (format-time-string "%l:%M %p %Z" start-time zone)) + emacsconf-status-timezones + "")) + track) + " + ${name}${status}${time-info} +"))) + emacsconf-tracks "\n") + ) + " + + + + + + ${name} ${year} ~ Live + + + +
+

${name} ${year} Livestreams

+

December 3 (Saturday) and 4 (Sunday), 2022

+
+
+ + + + + +${timezone-info} + + + +${watch-info} + +
trackstatus
+

+ Click on the track names above to watch the stream in your browser. +

+

Watching the streams directly

+

+ You can also watch the streams in any media player that supports streaming. +

+ + + + + + + + +${stream-info} + +
trackstream address
+

+ Depending on which media player you use, you may enter the stream address + in a graphical user interface or provide it as an argument to the program + when launching it from the terminal. +

+

+ Examples: +

+
+mpv URL
+vlc URL
+ffplay URL
+
+
+ + + +")))) (provide 'emacsconf-stream) ;;; emacsconf-stream.el ends here -- cgit v1.2.3