You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
742 B
Clojure
26 lines
742 B
Clojure
(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 []
|
|
(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")
|
|
result (go
|
|
(let [response (<p! (.get masto rest-endpoint id-config))]
|
|
(get-content-seq response)))]
|
|
(pprint result)
|
|
result))
|
|
|
|
(defn add-one [a]
|
|
(+ a 1)) |