this repo has no description
0
fork

Configure Feed

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

formatting, debug

alice 1e6763a4 7d809702

+21 -18
+3 -3
src/config.ts
··· 8 8 export const WANTED_COLLECTION = 'app.bsky.feed.like'; 9 9 export const BSKY_IDENTIFIER = process.env.BSKY_IDENTIFIER ?? ''; 10 10 export const BSKY_PASSWORD = process.env.BSKY_PASSWORD ?? ''; 11 - export const CURSOR_UPDATE_INTERVAL = 12 - process.env.CURSOR_UPDATE_INTERVAL ? Number(process.env.CURSOR_UPDATE_INTERVAL) : 10000; 13 - 11 + export const CURSOR_UPDATE_INTERVAL = process.env.CURSOR_UPDATE_INTERVAL 12 + ? Number(process.env.CURSOR_UPDATE_INTERVAL) 13 + : 10000;
+7 -4
src/label.ts
··· 12 12 13 13 export const labelerServer = new LabelerServer({ did: DID, signingKey: SIGNING_KEY }); 14 14 15 + console.log('Starting labeler server on port ', PORT); 15 16 labelerServer.start(PORT, (error, address) => { 16 17 if (error) { 17 18 console.error(error); ··· 36 37 37 38 console.log(`Processing label for ${did}`); 38 39 39 - const query = labelerServer.db.prepare<unknown[], ComAtprotoLabelDefs.Label>(`SELECT * FROM labels WHERE uri = ?`).all(did); 40 + const query = labelerServer.db 41 + .prepare<unknown[], ComAtprotoLabelDefs.Label>(`SELECT * FROM labels WHERE uri = ?`) 42 + .all(did); 40 43 41 44 const labels = query.reduce((set, label) => { 42 45 if (!label.neg) set.add(label.val); ··· 44 47 return set; 45 48 }, new Set<string>()); 46 49 47 - console.log("labels: ", Array.from(labels)); 48 - 49 - console.log("got an rkey: ", rkey); 50 + console.log('labels: ', Array.from(labels)); 51 + 52 + console.log('got an rkey: ', rkey); 50 53 51 54 if (rkey.includes(DELETE)) { 52 55 await handleDeleteLabels(did, labels);
+10 -10
src/logger.ts
··· 3 3 const logger = pino({ 4 4 level: process.env.LOG_LEVEL ?? 'info', 5 5 transport: 6 - process.env.NODE_ENV !== 'production' ? 7 - { 8 - target: 'pino-pretty', 9 - options: { 10 - colorize: true, 11 - translateTime: 'SYS:standard', 12 - ignore: 'pid,hostname', 13 - }, 14 - } 15 - : undefined, 6 + process.env.NODE_ENV !== 'production' 7 + ? { 8 + target: 'pino-pretty', 9 + options: { 10 + colorize: true, 11 + translateTime: 'SYS:standard', 12 + ignore: 'pid,hostname', 13 + }, 14 + } 15 + : undefined, 16 16 timestamp: pino.stdTimeFunctions.isoTime, 17 17 }); 18 18
+1 -1
src/main.ts
··· 52 52 53 53 jetstream.onCreate(WANTED_COLLECTION, (event: CommitCreateEvent<typeof WANTED_COLLECTION>) => { 54 54 cursor = event.time_us; 55 - 55 + 56 56 if (event.commit?.record?.subject?.uri?.includes(DID)) { 57 57 label(event.did, event.commit.record.subject.uri.split('/').pop()).catch((error: unknown) => { 58 58 logger.error(`Unexpected error labeling ${event.did}:`);