Fix generation
This commit is contained in:
parent
d44a30577a
commit
984d4e00ea
2 changed files with 4 additions and 13 deletions
|
@ -57,7 +57,6 @@
|
|||
|
||||
(def like? (s/keys :req-un [context
|
||||
type-string
|
||||
id-uri
|
||||
to-uri
|
||||
actor
|
||||
object]))
|
||||
|
@ -67,8 +66,8 @@
|
|||
(def activity-streams-context "https://www.w3.org/ns/activitystreams")
|
||||
|
||||
(def like-data
|
||||
{:to "https://chatty.bla/ben/"
|
||||
:target "posts/234s23-2g34234-2hhj536"
|
||||
{:to ["https://chatty.bla/ben/", "https://chatty.bla/gen/"]
|
||||
:target "https://chatty.bla/ben/posts/234s23-2g34234-2hhj536"
|
||||
:from "https://social.bla/alyssa/"})
|
||||
|
||||
(defn generate-id-from-object [from]
|
||||
|
@ -79,7 +78,6 @@
|
|||
(assoc {}
|
||||
"@context" activity-streams-context
|
||||
"type" "Like"
|
||||
"id" (generate-id-from-object (:from input-map))
|
||||
"to" (:to input-map)
|
||||
"actor" (:from input-map)
|
||||
"object" (:target input-map)))
|
||||
|
@ -89,7 +87,7 @@
|
|||
filename string?]
|
||||
(->
|
||||
input
|
||||
(json/write-str)
|
||||
(json/write-str :escape-slash false)
|
||||
(#(spit filename %))))
|
||||
|
||||
|
||||
|
|
|
@ -1,8 +1 @@
|
|||
{
|
||||
"@context": "https:\/\/www.w3.org\/ns\/activitystreams",
|
||||
"type": "Like",
|
||||
"id": "https:\/\/social.bla\/alyssa\/out\/sdfsd44243g324g3455",
|
||||
"to": "https:\/\/chatty.bla\/ben\/",
|
||||
"actor": "https:\/\/social.bla\/alyssa\/",
|
||||
"object": "posts\/234s23-2g34234-2hhj536"
|
||||
}
|
||||
{"@context":"https://www.w3.org/ns/activitystreams","type":"Like","to":["https://chatty.bla/ben/","https://chatty.bla/gen/"],"actor":"https://social.bla/alyssa/","object":"https://chatty.bla/ben/posts/234s23-2g34234-2hhj536"}
|
Loading…
Reference in a new issue