diff --git a/src/main/dda/masto_embed/api.cljs b/src/main/dda/masto_embed/api.cljs index 85c6563..cb9e276 100644 --- a/src/main/dda/masto_embed/api.cljs +++ b/src/main/dda/masto_embed/api.cljs @@ -44,11 +44,22 @@ (or (some-> mastodon-config clj->js Mastodon.) (exit-with-error "missing Mastodon client configuration!"))) -(defn get-mastodon-timeline [mastodon-config callback] +(defn get-account-statuses [mastodon-config callback] (.then (.get (mastodon-client mastodon-config) (str "accounts/" (:account-id mastodon-config) "/statuses") #js {}) #(let [response (-> % .-data js->edn)] (if-let [error (:error response)] (exit-with-error error) - (callback response))))) \ No newline at end of file + (callback response))))) + +(defn get-directory [mastodon-config callback] + (.then (.get (mastodon-client mastodon-config) + (str "directory?local=true") + #js {}) + #(let [response (-> % .-data js->edn)] + (if-let [error (:error response)] + (exit-with-error error) + (callback response))))) + +(def my-config (create-config "2" "https://social.meissa-gmbh.de")) diff --git a/src/main/dda/masto_embed/app.cljs b/src/main/dda/masto_embed/app.cljs index 8f52211..2902bfb 100644 --- a/src/main/dda/masto_embed/app.cljs +++ b/src/main/dda/masto_embed/app.cljs @@ -34,6 +34,6 @@ (set! input))) (defn init [] - (api/get-mastodon-timeline + (api/get-account-statuses (mastodon-config-from-document) render-to-document)) \ No newline at end of file