A simple BlueSky profile labeler that can be ran on Cloudflare Workers github.com/SocksTheWolf/SimpleBSkyLabeler
cf bsky profile label bluesky cloudflare workers
1
fork

Configure Feed

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

Some signing code for future reference.

+23
+23
src/index.ts
··· 11 11 12 12 const LABEL_VERSION = 1; 13 13 14 + // TODO: Signatures. But do I really need them? Guess not. 15 + 16 + // export function formatLabel( 17 + // label: UnsignedLabel & { sig?: ArrayBuffer | Uint8Array | At.Bytes }, 18 + // ): FormattedLabel { 19 + // const sig = label.sig instanceof ArrayBuffer 20 + // ? toBytes(new Uint8Array(label.sig)) 21 + // : label.sig instanceof Uint8Array 22 + // ? toBytes(label.sig) 23 + // : label.sig; 24 + // if (!sig || !("$bytes" in sig)) { 25 + // throw new Error("Expected sig to be an object with base64 $bytes, got " + sig); 26 + // } 27 + // return { ...label, ver: LABEL_VERSION, neg: !!label.neg, sig }; 28 + // } 29 + 30 + // export function signLabel(label: UnsignedLabel, signingKey: Uint8Array): SignedLabel { 31 + // const toSign = formatLabelCbor(label); 32 + // const bytes = cborEncode(toSign); 33 + // const sig = k256Sign(signingKey, bytes); 34 + // return { ...toSign, sig }; 35 + // } 36 + 14 37 async function replay(sub: WebSocket, cursor: number | null) { 15 38 // XXX: Read from your DB any rows after `cursor`. 16 39 const rows = [