print mastodon statuses via mastodon-api interop
parent
c0431f5bae
commit
ed817a328d
File diff suppressed because it is too large
Load Diff
@ -1,7 +1,21 @@
|
||||
(ns dda.masto-embed.app)
|
||||
(ns dda.masto-embed.app
|
||||
(:require ["mastodon-api" :as Mastodon]
|
||||
[clojure.pprint :as pprint :refer [pprint]]
|
||||
[cljs.core.async :refer [go]]
|
||||
[cljs.core.async.interop :refer-macros [<p!]]))
|
||||
|
||||
(defn get-content-seq [response]
|
||||
(map
|
||||
#(aget % "content")
|
||||
(array-seq
|
||||
(aget response "data"))))
|
||||
|
||||
(defn init
|
||||
""
|
||||
[]
|
||||
(println "xx")
|
||||
"Hello world!")
|
||||
(defn init []
|
||||
(let [config (js-obj "api_url" "https://social.meissa-gmbh.de/api/v1/" "access_token" "...")
|
||||
masto (new Mastodon config)
|
||||
rest-endpoint "accounts/:id/statuses"
|
||||
id-config (js-obj "id" "2")]
|
||||
(pprint
|
||||
(go
|
||||
(let [response (<p! (.get masto rest-endpoint id-config))]
|
||||
(get-content-seq response)))))
|
||||
|
Loading…
Reference in New Issue