WIP: PDS Admin tool to hopefully make it easier to moderate your PDS
0
fork

Configure Feed

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

working

+28 -35
-16
lexicons.json
··· 1 - { 2 - "version": 1, 3 - "lexicons": [ 4 - "com.atproto.label.subscribeLabels" 5 - ], 6 - "resolutions": { 7 - "com.atproto.label.defs": { 8 - "uri": "at://did:plc:6msi3pj7krzih5qxqtryxlzw/com.atproto.lexicon.schema/com.atproto.label.defs", 9 - "cid": "bafyreig4hmnb2xkecyg4aaqfhr2rrcxxb3gsr4xks4rqb7rscrycalbrji" 10 - }, 11 - "com.atproto.label.subscribeLabels": { 12 - "uri": "at://did:plc:6msi3pj7krzih5qxqtryxlzw/com.atproto.lexicon.schema/com.atproto.label.subscribeLabels", 13 - "cid": "bafyreigeyxddcuwebpvscyy2l7s3urxsbdtzpjrljncjo4az62woytutx4" 14 - } 15 - } 16 - }
+28 -19
src/index.ts
··· 1 1 import { FirehoseSubscription } from "@atcute/firehose"; 2 2 import { ComAtprotoLabelSubscribeLabels } from "@atcute/atproto"; 3 3 4 - const subscription = new FirehoseSubscription({ 5 - service: "wss://ozone.skywatch.blue", 6 - nsid: ComAtprotoLabelSubscribeLabels.mainSchema, 7 - }); 4 + const listner = async (id: string, wss: string) => { 5 + const subscription = new FirehoseSubscription({ 6 + service: wss, 7 + nsid: ComAtprotoLabelSubscribeLabels.mainSchema, 8 + }); 8 9 9 - console.log("starting"); 10 - for await (const message of subscription) { 11 - switch (message.$type) { 12 - case "com.atproto.label.subscribeLabels#info": { 13 - console.log("commit:", message); 14 - break; 15 - } 16 - case "com.atproto.label.subscribeLabels#labels": { 17 - // repository commit (record creates, updates, deletes) 18 - for (const label of message.labels) { 19 - console.log("Label from: ", label.src); 20 - console.log("Label: ", label.val); 21 - console.log("Label for: ", label.uri); 10 + console.log(`Listening to ${id}`); 11 + for await (const message of subscription) { 12 + switch (message.$type) { 13 + case "com.atproto.label.subscribeLabels#info": { 14 + console.log("commit:", message); 15 + break; 16 + } 17 + case "com.atproto.label.subscribeLabels#labels": { 18 + // repository commit (record creates, updates, deletes) 19 + for (const label of message.labels) { 20 + console.log(`From: ${id}`); 21 + console.log("Label from: ", label.src); 22 + console.log("Label: ", label.val); 23 + console.log("Label for: ", label.uri); 24 + console.log("\n"); 25 + } 26 + break; 22 27 } 23 - break; 24 28 } 25 29 } 26 - } 30 + }; 31 + 32 + Promise.all([ 33 + listner("skywatch", "wss://ozone.skywatch.blue"), 34 + listner("bsky", "wss://mod.bsky.app"), 35 + ]);