updated bot to provide alt text for the posted media

added makefile for easier builds
This commit is contained in:
a. fox 2023-10-05 09:33:16 -04:00
parent b16c6c8815
commit ba745fa4b3
2 changed files with 24 additions and 2 deletions

19
Makefile Normal file
View File

@ -0,0 +1,19 @@
SYSTEM_NAME = out-of-touch-bot
define LISP_CMDS
"(handler-case \
(progn (ql:quickload :SYSTEM) \
(asdf:make :SYSTEM)) \
(error (e) \
(format t \"~A~%\" e) \
(uiop:quit 1)))"
endef
CMDS = --eval $(subst SYSTEM,$(SYSTEM_NAME),$(LISP_CMDS))
.PHONY: clean all
all:
ros $(CMDS)
clean:
rm -ri bin/

View File

@ -2,13 +2,16 @@
(in-package #:out-of-touch-bot)
(defvar *alt-text1*
"the intro to the Lucky Star anime with the song Out Of Touch by Hall & Oates overlaid on top of it")
(defun choose (c1 c2)
(if (> (random 1.0) .25) c1 c2))
(defun main ()
(let ((video2 (uiop:file-exists-p "video2.mp4")))
(unless (uiop:file-exists-p "video.mp4")
(format t "wha- where's the out of touch thursdays video? ;w;")
(format t "wha- where's the video? ;w;~%")
(uiop:quit 1))
(handler-case
(with-user-abort
@ -18,7 +21,7 @@
(post "its out of touch thursdays!" :visibility :public :media
(if video2
(choose #P"video.mp4" #P"video2.mp4")
#P"video.mp4")))))
`(#P"video.mp4" ,*alt-text1*))))))
(user-abort ()
(uiop:quit))
(error (e)