Innocenty Enikeew 10 роки тому
батько
коміт
8c2e5af5b2
2 змінених файлів з 4 додано та 2 видалено
  1. 1 0
      chatikbot.lisp
  2. 3 2
      foursquare.lisp

+ 1 - 0
chatikbot.lisp

@@ -277,6 +277,7 @@
           (unless (find id *fsq-seen-ids* :test #'equal)
           (unless (find id *fsq-seen-ids* :test #'equal)
             (loop for chat-id being the hash-keys in *fsq-send-to* using (hash-value users)
             (loop for chat-id being the hash-keys in *fsq-send-to* using (hash-value users)
                do (when (member user users :test #'equal)
                do (when (member user users :test #'equal)
+                    (log:info "Sending checkin" chat-id (fsq-format-checkin checkin))
                     (telegram-send-message chat-id (fsq-format-checkin checkin))))
                     (telegram-send-message chat-id (fsq-format-checkin checkin))))
             (push id *fsq-seen-ids*))))
             (push id *fsq-seen-ids*))))
     (error (e) (log:error e))))
     (error (e) (log:error e))))

+ 3 - 2
foursquare.lisp

@@ -32,10 +32,11 @@
                      (aget "code" meta) (aget "errorType" meta) (aget "errorDetail" meta))))    
                      (aget "code" meta) (aget "errorType" meta) (aget "errorDetail" meta))))    
     (aget "response" resp)))
     (aget "response" resp)))
 
 
-(defun fsq-fetch-checkins (&optional after-timestamp)
+(defun fsq-fetch-checkins (&optional after-timestamp limit)
   (aget "recent"
   (aget "recent"
         (%fsq-api-call "checkins/recent"
         (%fsq-api-call "checkins/recent"
-                       (list (cons "afterTimestamp" (or after-timestamp "0"))))))
+                       (list (cons "afterTimestamp" (or after-timestamp "0"))
+                             (cons "limit" (or limit "20"))))))
 
 
 (defun fsq-fetch-new-checkins ()
 (defun fsq-fetch-new-checkins ()
   (let ((recent (fsq-fetch-checkins *fsq-last-timestamp*)))
   (let ((recent (fsq-fetch-checkins *fsq-last-timestamp*)))