Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
catdevnull committed Feb 22, 2024
1 parent 99b0af8 commit 9ed626d
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/scripts/add-post-to-announcements.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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')

Expand All @@ -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)

Expand Down

0 comments on commit 9ed626d

Please sign in to comment.