summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSacha Chua <sacha@sachachua.com>2022-12-05 14:22:48 -0500
committerSacha Chua <sacha@sachachua.com>2022-12-05 14:22:48 -0500
commita2189b89cb5029236d60ea2f87942c70c4c4a0d6 (patch)
tree056ea1b9691ceb547ce8f2ad523bc04a2a220adc
parenta816549d8654b000e95fdf31e3fc0e8977761bee (diff)
downloademacsconf-el-a2189b89cb5029236d60ea2f87942c70c4c4a0d6.tar.xz
emacsconf-el-a2189b89cb5029236d60ea2f87942c70c4c4a0d6.zip
back up pads
-rw-r--r--emacsconf-pad.el30
1 files changed, 25 insertions, 5 deletions
diff --git a/emacsconf-pad.el b/emacsconf-pad.el
index aa326e5..243f973 100644
--- a/emacsconf-pad.el
+++ b/emacsconf-pad.el
@@ -99,11 +99,14 @@ You can find it in $ETHERPAD_PATH/APIKEY.txt"
(defun emacsconf-pad-get-html (pad-id)
(interactive "MPad ID: ")
- (emacsconf-pad-json-request (format "%sapi/1/getHTML?apikey=%s&padID=%s"
- emacsconf-pad-base
- (url-hexify-string emacsconf-pad-api-key)
- (url-hexify-string pad-id))
- (called-interactively-p 'any)))
+ (assoc-default
+ 'html
+ (assoc-default 'data
+ (emacsconf-pad-json-request (format "%sapi/1/getHTML?apikey=%s&padID=%s"
+ emacsconf-pad-base
+ (url-hexify-string emacsconf-pad-api-key)
+ (url-hexify-string pad-id))
+ (called-interactively-p 'any)))))
(defun emacsconf-pad-set-html (pad-id html)
(interactive "MPad ID: \nMHTML: ")
@@ -789,5 +792,22 @@ This page is for easy reference and recording. Please make sure any changes here
(emacsconf-prepare-for-display (emacsconf-get-talk-info)))
"</ul>")))
+(defun emacsconf-pad-backup-talk (talk)
+ (interactive (list (emacsconf-complete-talk-info)))
+ (with-temp-file (expand-file-name (concat (plist-get talk :video-slug) "--pad.html")
+ emacsconf-cache-dir)
+ (insert
+ (emacsconf-pad-get-html (emacsconf-pad-id talk))))
+ (call-process "pandoc" nil nil nil "-o"
+ (expand-file-name (concat (plist-get talk :video-slug) "--pad.md")
+ emacsconf-cache-dir)
+ (expand-file-name (concat (plist-get talk :video-slug) "--pad.html")
+ emacsconf-cache-dir)))
+
+(defun emacsconf-pad-backup-talks ()
+ (interactive)
+ (mapc
+ #'emacsconf-pad-backup-talk
+ (emacsconf-prepare-for-display (emacsconf-get-talk-info))))
(provide 'emacsconf-pad)
;;; emacsconf-pad.el ends here