aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorClyne Sullivan <clyne@bitgloo.com>2023-07-11 07:34:56 -0400
committerClyne Sullivan <clyne@bitgloo.com>2023-07-11 07:34:56 -0400
commit174d96bd2c35b9954a7b506aa77384f559de9fb0 (patch)
treecab87ca8f40ed533c2ec90543ea25b709f196096
parent16d879c6327ea3b2242aa165c4f1b7f132a84fbe (diff)
fix comment loading
-rw-r--r--src/lemmold/core.clj9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/lemmold/core.clj b/src/lemmold/core.clj
index 6528e51..73f96f7 100644
--- a/src/lemmold/core.clj
+++ b/src/lemmold/core.clj
@@ -22,7 +22,7 @@
(defn comments-list [post]
(-> (make-api-url INSTANCE COMMENTS)
- (api-call {:id (get-in post ["post" "id"])})
+ (api-call {:post_id (str (get-in post ["post" "id"]))})
(get "comments")))
(defn show-post-item [post]
@@ -34,7 +34,6 @@
(defn show-comment-item [commnt]
(println (get-in commnt ["creator" "name"]) "says:")
- (println (get-in commnt ["comment" "content"]))
(println)
)
@@ -52,20 +51,20 @@
(first (read-line)))
(defn show-comments-prompt []
- (print "BNPQ> ")
+ (print "BNP> ")
(flush)
(first (read-line)))
(defn view-post [post]
(println "Viewing post id:" (get-in post ["post" "id"]))
- (loop [offset 0 comments (comments-list (get-in post ["post" "id"]))]
+ (loop [offset 0 comments (comments-list post)]
+ (println (count comments) offset)
(show-comments (if (pos? offset) (drop (* 5 offset) comments) comments))
(flush)
(case (show-comments-prompt)
\B (println)
\N (recur (inc offset) comments)
\P (recur (dec offset) comments)
- \Q (println "Goodbye.")
(do (println "Unknown command.") (recur offset comments)))))
(defn -main [& args]