Last active
March 7, 2019 03:39
-
-
Save y2q-actionman/74d757a5c152f9ecf933d7983ac7db01 to your computer and use it in GitHub Desktop.
twitter に所定の時間に自動投稿する
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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