aboutsummaryrefslogtreecommitdiff
path: root/toots.lisp
blob: ed7303d7690a26d2ed8403a749e6faa1d3bc4048 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
(in-package :phaser.toots)

(ignore-errors
 ;; Don't signal if .env is missing.
 (.env:load-env (merge-pathnames ".env")))


(defvar *client*
  (make-instance 'tooter:client
		 :base (uiop:getenv "MASTODON_URL")
		 :name "Newsphaser bot"
		 :key (uiop:getenv "MASTODON_KEY")
		 :secret (uiop:getenv "MASTODON_SECRET")
		 :access-token (uiop:getenv "MASTODON_TOKEN")))

(defun get-timeline (&key (timeline :home) (limit 10) (max-id nil) (min-id nil))
  (tooter:timeline *client* timeline :limit limit :max-id max-id :min-id min-id))

(defun get-status (id)
  (tooter:find-status *client* id))

(defun post-toot (content)
  (tooter:make-status *client* content))