Advertisement
Guest User

Untitled

a guest
Apr 20th, 2019
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.99 KB | None | 0 0
  1. (ql:quickload :chirp)
  2.  
  3. (setf chirp:*oauth-api-key* "Put"
  4. chirp:*oauth-api-secret* "your"
  5. chirp:*oauth-access-token* "credencials"
  6. chirp:*oauth-access-secret* "here!")
  7.  
  8. (print (chirp:account/verify-credentials))
  9.  
  10. (defun status-text-without-mention (status)
  11. (chirp:replace-entities status (list :user-mention (lambda (x) ""))))
  12.  
  13. (defun user= (user1 user2)
  14. (eq (chirp-objects:id user1) (chirp-objects:id user2)))
  15.  
  16. (defun start ()
  17. (loop
  18. with time = (local-time:now)
  19. with last-id = nil
  20. for mentions = (chirp:statuses/mentions-timeline :since-id last-id)
  21. do (loop
  22. for mention in mentions
  23. when (local-time:timestamp<= time (chirp-objects:created-at mention))
  24. unless (user= (chirp:account/self) (chirp-objects:user mention))
  25. do (print mention)
  26. (chirp:reply mention (status-text-without-mention mention)))
  27. (when mentions
  28. (setf last-id (apply #'max (mapcar #'chirp-objects:id mentions))))
  29. (sleep (* 60 (/ 15 75)))))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement