this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

update skyware-firehose to v0.3.0

+26 -6
+7 -5
package-lock.json
··· 1 1 { 2 2 "name": "pronouns-bsky", 3 + "version": "1.0.0", 3 4 "lockfileVersion": 3, 4 5 "requires": true, 5 6 "packages": { 6 7 "": { 8 + "name": "pronouns-bsky", 9 + "version": "1.0.0", 7 10 "dependencies": { 8 11 "@atproto/api": "^0.12.23", 9 - "@skyware/firehose": "^0.2.0", 12 + "@skyware/firehose": "^0.3.0", 10 13 "dotenv": "^16.4.5" 11 14 }, 12 15 "devDependencies": { ··· 370 373 } 371 374 }, 372 375 "node_modules/@skyware/firehose": { 373 - "version": "0.2.0", 374 - "resolved": "https://registry.npmjs.org/@skyware/firehose/-/firehose-0.2.0.tgz", 375 - "integrity": "sha512-N3Z8PDb05JpQSTPMfe8mcAbE1zrFoPXLlhPKFio3Wyu+64ZW6g54htrOCX3S4CG7x7TYfWXc4au+hCny3F+1Mw==", 376 - "license": "MPL-2.0", 376 + "version": "0.3.0", 377 + "resolved": "https://registry.npmjs.org/@skyware/firehose/-/firehose-0.3.0.tgz", 378 + "integrity": "sha512-5Jc1ZfmcUKVWF8cCmZ1wKy9VtrwV5mQPizJeasbg0vv8KCi1DW7YdPJRk9j3n/8Qp7boRgrgRZYL1o7S2mvOVQ==", 377 379 "dependencies": { 378 380 "@atproto/repo": "^0.3.7", 379 381 "@atproto/xrpc-server": "^0.4.2",
+1 -1
package.json
··· 12 12 }, 13 13 "dependencies": { 14 14 "@atproto/api": "^0.12.23", 15 - "@skyware/firehose": "^0.2.0", 15 + "@skyware/firehose": "^0.3.0", 16 16 "dotenv": "^16.4.5" 17 17 } 18 18 }
+12
src/constants.ts
··· 27 27 "ze/hir": "ze", 28 28 "dey/deren": "dey", 29 29 none: "none", 30 + "e/em/er": "e2", 31 + "xier/xies": "xier", 32 + "sier/sies": "sier2", 33 + "ens/ens": "ens", 30 34 }; 31 35 32 36 export const URIs: Record<string, string> = { ··· 84 88 "dey/deren", 85 89 "at://did:plc:wkoofae5uytcm7bjncmev6n6/app.bsky.feed.post/3kwxljuxooh2r": 86 90 "none", 91 + "at://did:plc:wkoofae5uytcm7bjncmev6n6/app.bsky.feed.post/3kwzimwll6j2q": 92 + "e/em/er", 93 + "at://did:plc:wkoofae5uytcm7bjncmev6n6/app.bsky.feed.post/3kwzmcaue3e22": 94 + "xier/xies", 95 + "at://did:plc:wkoofae5uytcm7bjncmev6n6/app.bsky.feed.post/3kwzmclqnud2t": 96 + "sier/sies", 97 + "at://did:plc:wkoofae5uytcm7bjncmev6n6/app.bsky.feed.post/3kx22bkmnco2t": 98 + "ens/ens", 87 99 }; 88 100 89 101 export const DID = process.env.DID ?? "";
+6
src/main.ts
··· 9 9 const agent = await getAgent(); 10 10 11 11 let cursorFirehose = 0; 12 + let oldCursor = 0; 12 13 let cursorFile = fs.readFileSync("cursor.txt", "utf8"); 13 14 14 15 const firehose = new Firehose({ cursor: cursorFile ?? "" }); ··· 20 21 21 22 firehose.on("open", () => { 22 23 setInterval(() => { 24 + if (oldCursor && oldCursor == cursorFirehose) { 25 + firehose.close(); 26 + subscribe(); 27 + } 28 + oldCursor = cursorFirehose; 23 29 const timestamp = new Date().toISOString(); 24 30 console.log(`${timestamp} cursor: ${cursorFirehose}`); 25 31 fs.writeFile("cursor.txt", cursorFirehose.toString(), (err) => {