Pronouns labels on Bluesky

fixes

Changed files
+4 -3
src
+2 -1
src/constants.ts
···
export const DID = process.env.DID ?? "";
export const SIGNING_KEY = process.env.SIGNING_KEY ?? "";
-
export const PORT = 4001;
+
export const PORT = Number(process.env.PORT ?? 4001);
+
export const URL = process.env.URL ?? "wss://jetstream.atproto.tools/subscribe";
export const LABEL_LIMIT = 4;
export const DELETE = "3kwsqucto3j2a";
export const POSTS: Record<string, string> = {
+2 -2
src/main.ts
···
import { label } from "./label.js";
-
import { DID } from "./constants.js";
+
import { DID, URL } from "./constants.js";
import fs from "node:fs";
import { Jetstream } from "@skyware/jetstream";
import { AppBskyFeedLike } from "@atcute/client/lexicons";
···
if (cursorFile) console.log(`Initiate firehose at cursor ${cursorFile}`);
const jetstream = new Jetstream({
+
endpoint: URL,
wantedCollections: ["app.bsky.feed.like"],
cursor: cursorFile ?? 0,
});
···
jetstream.on("open", () => {
intervalID = setInterval(() => {
if (jetstream.cursor) {
-
console.log(`${new Date().toISOString()}: ${jetstream.cursor}`);
fs.writeFile("cursor.txt", jetstream.cursor.toString(), (err) => {
if (err) console.log(err);
});