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

This commit is contained in:
jem 2020-04-24 14:52:51 +02:00
commit 966799265f
3 changed files with 1679 additions and 11 deletions

1656
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

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

View file

@ -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 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 add-one [a] (defn add-one [a]
(+ a 1)) (+ a 1))
(defn init
""
[]
(println "xx")
"Hello world!")