(in-package #:chatikbot) ;; Load config file (alexandria:when-let (file (probe-file (merge-pathnames "config.lisp" (asdf:component-pathname (asdf:find-system '#:chatikbot))))) (load file)) (defparameter +akb-user-id+ "3021296351" "Twitter user id of 'B-category anecdotes'") (defvar *akb-max-count* 5 "Max number of tweets to return per run") (defvar *akb-last-id* nil "id of last AKB tweet") (defun fetch-latest-akb () (loop for (id . text) in (get-tweets +akb-user-id+ :since-id *akb-last-id* :count *akb-max-count*) do (setf *akb-last-id* (max (or *akb-last-id* 0) id)) collect text))