Merge branch 'shadow-cljs' of github.com:DomainDrivenArchitecture/dda-masto-embed into shadow-cljs

shadow-cljs
jem 4 years ago
commit 966799265f

1656
package-lock.json generated

File diff suppressed because it is too large Load Diff

@ -6,5 +6,7 @@
"shadow-cljs": "2.8.100",
"source-map-support": "^0.5.19"
},
"dependencies": {}
"dependencies": {
"mastodon-api": "^1.3.0"
}
}

@ -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…
Cancel
Save