From 315d13b733b3f41191279a6e897e4bbe89896004 Mon Sep 17 00:00:00 2001 From: rsiddharth Date: Tue, 18 Jun 2019 19:50:23 -0400 Subject: hn/g: Add athings:list. * hn/g (athings:list): New function. --- hn/g | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/hn/g b/hn/g index d2c8f0d..d8855aa 100755 --- a/hn/g +++ b/hn/g @@ -13,6 +13,7 @@ (require racket/format) (require racket/string) +(require json) (require net/http-client) (require openssl) @@ -78,3 +79,8 @@ (call-with-input-file f (λ (in) (read-json in)))) (else (make-immutable-hash)))) +(define (athings:list) + (let ((f (build-path (athings:data-dir) "list"))) + (cond ((file-exists? f) (call-with-input-file f (λ (in) (read-json in)))) + (else '())))) + -- cgit v1.2.3