-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
99b0af8
commit 9ed626d
Showing
1 changed file
with
14 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ import envPaths from 'env-paths' | |
import { Level } from 'level' | ||
|
||
import Store from '../server/store/index.js' | ||
import { nanoid } from 'nanoid' | ||
|
||
const paths = envPaths('social.distributed.press') | ||
|
||
|
@@ -19,8 +20,20 @@ const db = new Level(storage, { valueEncoding: 'json' }) | |
const store = new Store(db) | ||
|
||
console.log(`Posting: ${content}`) | ||
const actor=await store.announcements.getInfo() | ||
|
||
await store.announcements.outbox.add({ | ||
id: | ||
'@context': 'https://www.w3.org/ns/activitystreams', | ||
type: 'Note', | ||
id: `${actor.actorUrl}/outbox/${nanoid()}`, | ||
actor: actor.actorUrl, | ||
attributedTo: actor.actorUrl, | ||
published: new Date().toUTCString(), | ||
"to": ["https://www.w3.org/ns/activitystreams#Public"], | ||
"cc": ["https://social.distributed.press/v1/@[email protected]/followers"], | ||
object: { | ||
|
||
} | ||
}) | ||
await store.admins.add(list) | ||
|
||
|