Guest User

Untitled

a guest
Jan 11th, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. (in-package :cl-user)
  2.  
  3. #|
  4. (ql:quickload :chirp)
  5.  
  6. (setf chirp:*oauth-api-key* "**************************"
  7. chirp:*oauth-api-secret* "***************************"
  8. chirp:*oauth-access-token* "*******************************"
  9. chirp:*oauth-access-secret* "***************************")
  10. |#
  11.  
  12. (defvar *tw-threads*
  13. ())
  14.  
  15. (defun update-at-time (target-time status)
  16. (flet ((worker ()
  17. (loop for now = (get-universal-time)
  18. if (>= now target-time)
  19. do (chirp:statuses/update status)
  20. (loop-finish)
  21. else
  22. do (sleep 1/8))))
  23. (push (sb-thread:make-thread #'worker :name "tw-thread")
  24. *tw-threads*)))
  25.  
  26. (defun reap-tw-threads ()
  27. (setf *tw-threads*
  28. (delete-if-not #'sb-thread:thread-alive-p *tw-threads*)))
  29.  
  30. #|
  31. (update-at-time (encode-universal-time 0 41 22 3 1 2018)
  32. "hoge fuga piyo")
  33. |#
Add Comment
Please, Sign In to add comment