diff options
Diffstat (limited to 'reporter.lisp')
-rw-r--r-- | reporter.lisp | 33 |
1 files changed, 21 insertions, 12 deletions
diff --git a/reporter.lisp b/reporter.lisp index 48ec0fa..2ebe6b9 100644 --- a/reporter.lisp +++ b/reporter.lisp @@ -34,6 +34,7 @@ (defvar *max-requests* 20) (defvar *top-statuses-to-boost* 10) +(defvar *excerpt-length* 100) (defun outdated-statuses (page) (remove-if @@ -50,10 +51,10 @@ (let* ((max-id (if (null pages) nil (tooter:id (car (last (car pages)))))) - (page (tooter:timeline *client* :home - :limit *timeline-page-size* - :max-id max-id - :min-id min-id)) + (page (get-timeline :timeline :home + :limit *timeline-page-size* + :max-id max-id + :min-id min-id)) (statuses-and-page (if (null pages) (list page) (cons page pages)))) @@ -85,12 +86,20 @@ (defun summarize-top-statuses () (let ((statuses (load-top-statuses))) - (mapcar (lambda (status) - (text-excerpt (tooter:content status))) - statuses))) + (remove-if #'null + (mapcar (lambda (status) + (let ((excerpt (text-excerpt (tooter:content status) *excerpt-length*))) + (if excerpt + (format nil "~a:~%~a" + excerpt + (tooter:url status)) + nil))) + statuses)))) -(defun reblog-top-statuses () - (let ((top-statuses (load-top-statuses))) - (mapc (lambda (status) - (tooter:favourite *client* status)) - top-statuses))) +(defun summarize-and-post-top-statuses () + (let ((summaries (summarize-top-statuses))) + (post-toot (format nil "~{~a~%~%~}" summaries)))) + +(when nil + (summarize-top-statuses) + (summarize-and-post-top-statuses)) |