this repo has no description
0
fork

Configure Feed

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

random selection first

alice a0de338c 97202c90

+15 -67
+7 -58
src/constants.ts
··· 3 3 export const DID = process.env.DID ?? ""; 4 4 export const SIGNING_KEY = process.env.SIGNING_KEY ?? ""; 5 5 export const PORT = 4001; 6 - export const LABEL_LIMIT = 4; 7 - export const DELETE = "3kwsqucto3j2a"; 8 - export const POSTS: Record<string, string> = { 9 - "3kwss4ldkwd2j": "they", 10 - "3kwss4fmiow2n": "it", 11 - "3kwss4bzqlw2k": "he", 12 - "3kwss45mxrh2j": "she", 13 - "3kwst2tn2342f": "bio", 14 - "3kwsslg3gqk2t": "avoid", 15 - "3kwssldhzme27": "ask", 16 - "3kwss4vc4cw2x": "any", 17 - "3kwu55hxj4b2a": "fae", 18 - "3kwu5d6rq352v": "bun", 19 - "3kwu5s4lt6f2k": "xe", 20 - "3kwu5sjyg4m2f": "drae", 21 - "3kwu5stootb2q": "e", 22 - "3kwu5taglmr2q": "sier", 23 - "3kwu6b3cnd52k": "ey", 24 - "3kwu7n26cgm2m": "shey", 25 - "3kwue4lqwjb2q": "voi", 26 - "3kwueewr2p22j": "mew", 27 - "3kwukwwz4nt2j": "paw", 28 - "3kwuv4vxgwu2n": "kit", 29 - "3kwuv56n4jv2g": "zie", 30 - "3kwuvaelsru2m": "ae", 31 - "3kwv2d6oguw2n": "prince", 32 - "3kwvcc736wg2n": "ze", 33 - "3kwwwvsvcnz2h": "dey", 34 - "3kwxljuxooh2r": "none", 35 - "3kwzimwll6j2q": "e-em-er", 36 - "3kwzmcaue3e22": "xier", 37 - "3kwzmclqnud2t": "sier-sies", 38 - "3kx22bkmnco2t": "ens", 39 - "3kx45q2fq372f": "squee", 40 - "3kx4puqpu5q2j": "vi", 41 - "3kxntgh45yy2j": "ne-nem-nir", 42 - "3kxqmnktb532k": "ze-zim", 43 - "3kxsppngl4e2a": "pup-pups-pupself", 44 - "3kxvjiundpz2r": "zi-zir", 45 - "3kxvjixhmhh2g": "he-haw", 46 - "3kxwujilwty2m": "hee-haw", 47 - "3kxy7b27dke2w": "zhi-zhr", 48 - "3ky7xcoqkza2q": "ve-ver", 49 - "3kygr2mke2t2z": "si-hir", 50 - "3kyikdvmeff2g": "she-we", 51 - "3kyikdz4eau2a": "he-we", 52 - "3kyike4fibu2k": "they-we", 53 - "3kyilq67fyv2a": "xe-xem", 54 - "3kzfbgd3jpz2k": "sun-suns", 55 - "3kzfbgi7is225": "leaf-leafs", 56 - "3kzftskynd32l": "shiv-ver", 57 - "3l2jb2koecj27": "ferret-ferrets", 58 - "3l2kx6qwefk2h": "drusshe-drayr", 59 - "3l2xlzk6lrx2r": "frog-frogs", 60 - "3l2xlzt6v5z2x": "rat-rats", 61 - "3l2zv7xcpq62u": "shark-sharks", 62 - "3l32xb7nvgh2x": "proper-nouns", 63 - }; 6 + export const DELETE = "3l3izhv734g2o"; 7 + export const HOUSES = [ 8 + "gryffindor", 9 + "slytherin", 10 + "ravenclaw", 11 + "hufflepuff", 12 + ];
+8 -7
src/label.ts
··· 2 2 import { 3 3 DID, 4 4 PORT, 5 - LABEL_LIMIT, 6 - POSTS, 5 + HOUSES, 7 6 SIGNING_KEY, 8 7 DELETE, 9 8 } from "./constants.js"; ··· 39 38 }, new Set<string>()); 40 39 41 40 if (rkey.includes(DELETE)) { 41 + const randomHouse = HOUSES[Math.floor(Math.random() * HOUSES.length)]; 42 42 await server 43 - .createLabels({ uri: did }, { negate: [...labels] }) 43 + .createLabels({ uri: did }, { negate: [randomHouse] }) 44 44 .catch((err) => { 45 45 console.log(err); 46 46 }) 47 - .then(() => console.log(`Deleted labels for ${did}`)); 48 - } else if (labels.size < LABEL_LIMIT && POSTS[rkey]) { 47 + .then(() => console.log(`Deleted label ${randomHouse} for ${did}`)); 48 + } else { 49 + const randomHouse = HOUSES[Math.floor(Math.random() * HOUSES.length)]; 49 50 await server 50 - .createLabel({ uri: did, val: POSTS[rkey] }) 51 + .createLabel({ uri: did, val: randomHouse }) 51 52 .catch((err) => { 52 53 console.log(err); 53 54 }) 54 - .then(() => console.log(`Labeled ${did} with ${POSTS[rkey]}`)); 55 + .then(() => console.log(`Labeled ${did} with ${randomHouse}`)); 55 56 } 56 57 };
-2
src/main.ts
··· 35 35 commit.ops.forEach(async (op) => { 36 36 if (op.action !== "delete" && AppBskyFeedLike.isRecord(op.record)) { 37 37 if (op.record.subject.uri.includes(DID)) { 38 - if (op.record.subject.uri.includes("app.bsky.feed.post")) { 39 38 await label( 40 39 commit.repo, 41 40 op.record.subject.uri.split("/").pop()!, 42 41 ).catch((err) => console.error(err)); 43 - } 44 42 } 45 43 } 46 44 });