Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (ql:quickload :chirp)
- (setf chirp:*oauth-api-key* "Put"
- chirp:*oauth-api-secret* "your"
- chirp:*oauth-access-token* "credencials"
- chirp:*oauth-access-secret* "here!")
- (print (chirp:account/verify-credentials))
- (defun status-text-without-mention (status)
- (chirp:replace-entities status (list :user-mention (lambda (x) ""))))
- (defun user= (user1 user2)
- (eq (chirp-objects:id user1) (chirp-objects:id user2)))
- (defun start ()
- (loop
- with time = (local-time:now)
- with last-id = nil
- for mentions = (chirp:statuses/mentions-timeline :since-id last-id)
- do (loop
- for mention in mentions
- when (local-time:timestamp<= time (chirp-objects:created-at mention))
- unless (user= (chirp:account/self) (chirp-objects:user mention))
- do (print mention)
- (chirp:reply mention (status-text-without-mention mention)))
- (when mentions
- (setf last-id (apply #'max (mapcar #'chirp-objects:id mentions))))
- (sleep (* 60 (/ 15 75)))))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement