generated from nhcarrigan/template
feat: add mastodon
This commit is contained in:
parent
ef00f107e9
commit
83ea0a33f2
1
prod.env
1
prod.env
@ -5,3 +5,4 @@ SLACK_SIGNING_SECRET="op://Environment Variables - Naomi/Mommy/slack_signing_sec
|
|||||||
SLACK_CLIENT_ID="op://Environment Variables - Naomi/Mommy/slack_client_id"
|
SLACK_CLIENT_ID="op://Environment Variables - Naomi/Mommy/slack_client_id"
|
||||||
BSKY_PASSWORD="op://Environment Variables - Naomi/Mommy/bsky_pass"
|
BSKY_PASSWORD="op://Environment Variables - Naomi/Mommy/bsky_pass"
|
||||||
SLACK_STATE_SECRET="op://Environment Variables - Naomi/Mommy/slack_state_secret"
|
SLACK_STATE_SECRET="op://Environment Variables - Naomi/Mommy/slack_state_secret"
|
||||||
|
FEDI_TOKEN="op://Environment Variables - Naomi/Mommy/mastodon_token"
|
13
src/index.ts
13
src/index.ts
@ -73,7 +73,18 @@ scheduleJob("0 9 * * *", async() => {
|
|||||||
await bsky.post({
|
await bsky.post({
|
||||||
text: response,
|
text: response,
|
||||||
});
|
});
|
||||||
await logger.log("info", "Posted to bsky.social!");
|
await fetch(`https://fedi.nhcarrigan.com/api/notes/create`, {
|
||||||
|
body: JSON.stringify({
|
||||||
|
text: response,
|
||||||
|
visibility: "public",
|
||||||
|
}),
|
||||||
|
headers: {
|
||||||
|
"Authorization": `Bearer ${process.env.FEDI_TOKEN}`,
|
||||||
|
"Content-Type": "application/json",
|
||||||
|
},
|
||||||
|
method: "POST",
|
||||||
|
});
|
||||||
|
await logger.log("info", "Posted to bsky and fedi!");
|
||||||
});
|
});
|
||||||
|
|
||||||
serve();
|
serve();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user