add dir-api
This commit is contained in:
parent
41a1387bdb
commit
de0c47124c
2 changed files with 14 additions and 3 deletions
|
@ -44,11 +44,22 @@
|
||||||
(or (some-> mastodon-config clj->js Mastodon.)
|
(or (some-> mastodon-config clj->js Mastodon.)
|
||||||
(exit-with-error "missing Mastodon client configuration!")))
|
(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)
|
(.then (.get (mastodon-client mastodon-config)
|
||||||
(str "accounts/" (:account-id mastodon-config) "/statuses")
|
(str "accounts/" (:account-id mastodon-config) "/statuses")
|
||||||
#js {})
|
#js {})
|
||||||
#(let [response (-> % .-data js->edn)]
|
#(let [response (-> % .-data js->edn)]
|
||||||
(if-let [error (:error response)]
|
(if-let [error (:error response)]
|
||||||
(exit-with-error error)
|
(exit-with-error error)
|
||||||
(callback response)))))
|
(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"))
|
||||||
|
|
|
@ -34,6 +34,6 @@
|
||||||
(set! input)))
|
(set! input)))
|
||||||
|
|
||||||
(defn init []
|
(defn init []
|
||||||
(api/get-mastodon-timeline
|
(api/get-account-statuses
|
||||||
(mastodon-config-from-document)
|
(mastodon-config-from-document)
|
||||||
render-to-document))
|
render-to-document))
|
Loading…
Reference in a new issue