This repository has been archived on 2023-10-05. You can view files and clone it, but cannot push or open issues or pull requests.
friday-bot/friday-bot.lisp

28 lines
1.2 KiB
Common Lisp

;;;; out-of-touch-bot.lisp
(in-package #:friday-bot)
(defvar *alt-text*
"a snippet from David Lynch's film 'Rabbits'
the video shows three anthropomorphic rabbits sitting in a sparse apartment, two are sitting on a couch with the third standing behind it. the one standing behind the couch says 'do not forget today is friday', which is followed by a laugh track. all three rabbits do nothing while the laugh track plays.")
(defun main ()
(unless (uiop:file-exists-p "video.mp4")
(format t "wha- where's the video? ;w;")
(uiop:quit 1))
(handler-case
(with-user-abort
(run-bot ((make-instance 'mastodon-bot :config-file "config.file")
:with-websocket nil)
(on (:friday :at "13:00")
(post "don't forget that today is friday." :visibility :public :media
`((#P"video.mp4" ,*alt-text*))))))
(user-abort ()
(uiop:quit))
(error (e)
(with-open-file (out "error.log" :direction :output
:if-does-not-exist :create
:if-exists :overwrite)
(format out "error: ~a~%" e)))))