Merge branch 'shadow-cljs' of github.com:DomainDrivenArchitecture/dda-masto-embed into shadow-cljs
commit
966799265f
File diff suppressed because it is too large
Load Diff
@ -1,10 +1,24 @@
|
||||
(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 add-one [a]
|
||||
(+ a 1))
|
||||
(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))))))
|
||||
|
||||
(defn init
|
||||
""
|
||||
[]
|
||||
(println "xx")
|
||||
"Hello world!")
|
||||
(defn add-one [a]
|
||||
(+ a 1))
|
Loading…
Reference in New Issue