tapris being a Pleroma bot

epimorphism addc4d246f add requirements 3 years ago
tapris ed26f43e8c add support for content_type for `post-status' 3 years ago
LICENSE 373f1fa1bb add GPL 3 years ago
README.md addc4d246f add requirements 3 years ago
example.scm ceec6f88ba add an example 3 years ago
nodeinfo.scm 2b93c99b58 [nodeinfo]: add enabled formats 3 years ago
rmsrss.scm d1d3b7b880 [rmsrss]: initial import 3 years ago


Tapris, will eventually be a powerful Pleromer bot UwU



  • Guile >= 2.2
  • guile-json


You can include the modules with (use-modules (tapris client)) (make sure to have the directory with client.scm in your GUILE_LOAD_PATH.

The basic work-flow is as follows:

1) Obtain a client by using (register-app).

 (ice-9 format)
 (srfi srfi-1)
 (web uri)
 (tapris client))

(define instance (string->uri "https://letsalllovela.in"))

(define client (register-app instance))

2) Obtain an authorization code by asking the user to visit the url obtained from build-authorize-url. This authorization code can only be used once.

(define (ask-for-code client)
  (let ((u (build-authorize-url client)))
    (format #t "Please visit the following URL to obtain the \
authorization code: ~a\n" (uri->string u))))

(ask-for-code client)
;; obtain the AUTH_CODE here

3) Obtain an access token with get-token using the authorization code. Store this token somewhere in order to reuse it.

(define token (get-token client AUTH_CODE))
(display token) (newline)
(set-client-token! client token)

4) Optionally, verify the token with verify-credentials.

(verify-credentials client)
;; examine the output

5) You can shitpost now!

(post-media client "/home/lain/swimsuit.jpg" #:status "ayyuwu")


The code here is heavily based on guile-mastodon by Pierre-Antoine Rouby. I didn't manage to get it work well, and didn't like the API that much, so I just copied some of the parts that I need. But big time kudos for the define-json-reader macro that I took almost verbatim.

Contact: epi@disroot.org