From 631a6472551e7802673468a745263c04ae145c04 Mon Sep 17 00:00:00 2001 From: bom Date: Fri, 4 Mar 2022 10:53:19 +0100 Subject: [PATCH] WIP mob --- src/main/dda/masto_embed/api.cljs | 10 ++++++++++ src/main/dda/masto_embed/app.cljs | 27 ++++++++++++++------------- 2 files changed, 24 insertions(+), 13 deletions(-) diff --git a/src/main/dda/masto_embed/api.cljs b/src/main/dda/masto_embed/api.cljs index 85354aa..4de34c9 100644 --- a/src/main/dda/masto_embed/api.cljs +++ b/src/main/dda/masto_embed/api.cljs @@ -51,6 +51,16 @@ (str "statuses/" status-id "/context") #js {})) +(defn get-filtered-replies + [host-url + status-id + account] + (->> (.get (mastodon-client host-url) + (str "statuses/" status-id "/context") + #js {}) + mastojs->edn + (:descendants))) + (defn get-favorited-by [host-url status-id] diff --git a/src/main/dda/masto_embed/app.cljs b/src/main/dda/masto_embed/app.cljs index 882cb14..3c15b9a 100644 --- a/src/main/dda/masto_embed/app.cljs +++ b/src/main/dda/masto_embed/app.cljs @@ -66,9 +66,7 @@ (edn (filter #(= account-name (:acct %))) - (empty?) - (not) - (infra/debug)))) + ))) out)) (defn init [] @@ -82,21 +80,24 @@ (edn) test-status (-> - (edn) - filtered (->> - (:descendants test-status) - (filter #(favorited-replies? host-url (:id %) account-name)) - (infra/debug))] + filtered (filter #(go (> statuus ; (take 4) ; (rb/masto->html) ; (render-html) ; (render-to-document)) - (->> filtered - (infra/debug) - (rb/masto->html) - (render-html) - (render-to-document))))) + ;(go (infra/debug (edn (> filtered + ; (infra/debug) + ; (rb/masto->html) + ; (render-html) + ; (render-to-document)) + )))