summaryrefslogtreecommitdiff
path: root/qkbox/toot.scm
diff options
context:
space:
mode:
Diffstat (limited to 'qkbox/toot.scm')
-rw-r--r--qkbox/toot.scm29
1 files changed, 28 insertions, 1 deletions
diff --git a/qkbox/toot.scm b/qkbox/toot.scm
index 0ccad60..7b12487 100644
--- a/qkbox/toot.scm
+++ b/qkbox/toot.scm
@@ -100,7 +100,6 @@
,@(if local? `((local . ,local?)) '()))
#:authorization? #t))
-
(define (favourite id)
(define-values (res body)
(/api/v1/statuses/:id/favourite id))
@@ -129,6 +128,34 @@
(format #f "/api/v1/statuses/~a/unfavourite" id)
#:authorization? #t))
+(define (reblog id)
+ (define-values (res body)
+ (/api/v1/statuses/:id/reblog id))
+ (case (response-code res)
+ ((200) #t)
+ (else
+ (error "reblog: failed" res body))))
+
+(define (/api/v1/statuses/:id/reblog id)
+ (request
+ 'POST
+ (format #f "/api/v1/statuses/~a/reblog" id)
+ #:authorization? #t))
+
+(define (unreblog id)
+ (define-values (res body)
+ (/api/v1/statuses/:id/unreblog id))
+ (case (response-code res)
+ ((200) #t)
+ (else
+ (error "unreblog: failed" res body))))
+
+(define (/api/v1/statuses/:id/unreblog id)
+ (request
+ 'POST
+ (format #f "/api/v1/statuses/~a/unreblog" id)
+ #:authorization? #t))
+
(define* (request method path #:key json authorization?)
(define-values (res body)
(http-request (string-append "https://"