summaryrefslogtreecommitdiff
path: root/haunt/jakob/utils/comments.scm
diff options
context:
space:
mode:
authorJakob L. Kreuze <zerodaysfordays@sdf.org>2022-12-03 12:57:43 -0500
committerJakob L. Kreuze <zerodaysfordays@sdf.org>2022-12-03 12:57:43 -0500
commit59f3b1b7899e11a7b6c117e25041245c8acf65d6 (patch)
treecb96437088dd2779b32f10f53c0f30e75ff180e6 /haunt/jakob/utils/comments.scm
parentcce41bf0df30a52a32daedb717c3a21181635dcf (diff)
[dynamic] Reach out to API instead of PostgreSQL
Diffstat (limited to 'haunt/jakob/utils/comments.scm')
-rw-r--r--haunt/jakob/utils/comments.scm10
1 files changed, 9 insertions, 1 deletions
diff --git a/haunt/jakob/utils/comments.scm b/haunt/jakob/utils/comments.scm
index e228a6d..8678a3a 100644
--- a/haunt/jakob/utils/comments.scm
+++ b/haunt/jakob/utils/comments.scm
@@ -213,7 +213,15 @@
(define (fetch-comments slug)
"Blocking call to webmention.io to retrieve a vector of all Webmentions for `slug'"
- (get-comments-by-slug slug))
+ (let ((url (format #f "https://jakob.space/api/comments?p=~a" slug)))
+ (receive (response-status response-body)
+ (http-request url)
+ (chain response-body
+ (bytevector->string _ "UTF-8")
+ (json-string->scm _)
+ (vector->list _)
+ (map scm->json-string _)
+ (map (lambda (x) (call-with-input-string x json->internal-comment)) _)))))
(define (fetch-webmentions slug)
"Blocking call to webmention.io to retrieve a vector of all Webmentions for `slug'"