Skip to content

Instantly share code, notes, and snippets.

@y2q-actionman
Last active March 7, 2019 03:39
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save y2q-actionman/74d757a5c152f9ecf933d7983ac7db01 to your computer and use it in GitHub Desktop.
Save y2q-actionman/74d757a5c152f9ecf933d7983ac7db01 to your computer and use it in GitHub Desktop.
twitter に所定の時間に自動投稿する
(in-package :cl-user)
#|
(ql:quickload :chirp)
(setf chirp:*oauth-api-key* "**************************"
chirp:*oauth-api-secret* "***************************"
chirp:*oauth-access-token* "*******************************"
chirp:*oauth-access-secret* "***************************")
|#
(defvar *tw-threads*
())
(defun update-at-time (target-time status)
(flet ((worker ()
(loop for now = (get-universal-time)
if (>= now target-time)
do (chirp:statuses/update status)
(loop-finish)
else
do (sleep 1/8))))
(push (sb-thread:make-thread #'worker :name "tw-thread")
*tw-threads*)))
(defun reap-tw-threads ()
(setf *tw-threads*
(delete-if-not #'sb-thread:thread-alive-p *tw-threads*)))
#|
(update-at-time (encode-universal-time 0 41 22 3 1 2018)
"hoge fuga piyo")
|#
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment