this repo has no description
0
fork

Configure Feed

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

fix error and stuff idk

+85 -134
+74 -128
package-lock.json
··· 6 6 "": { 7 7 "dependencies": { 8 8 "@atproto/api": "^0.12.23", 9 - "@skyware/firehose": "^0.1.5", 9 + "@skyware/firehose": "^0.2.0", 10 10 "dotenv": "^16.4.5" 11 11 }, 12 12 "devDependencies": { ··· 29 29 "tlds": "^1.234.0" 30 30 } 31 31 }, 32 + "node_modules/@atproto/common": { 33 + "version": "0.3.4", 34 + "resolved": "https://registry.npmjs.org/@atproto/common/-/common-0.3.4.tgz", 35 + "integrity": "sha512-qjOHcyeHjGRJseYbdnl+0PViDlMRN9GR0/1ToGKAmXh0voz4LbBWU1FwtGF7CvTlbom9MZYhu21lF5pD5RqBwQ==", 36 + "license": "MIT", 37 + "dependencies": { 38 + "@atproto/common-web": "^0.2.4", 39 + "@ipld/dag-cbor": "^7.0.3", 40 + "cbor-x": "^1.5.1", 41 + "iso-datestring-validator": "^2.2.2", 42 + "multiformats": "^9.9.0", 43 + "pino": "^8.15.0", 44 + "zod": "3.21.4" 45 + } 46 + }, 32 47 "node_modules/@atproto/common-web": { 33 48 "version": "0.3.0", 34 49 "resolved": "https://registry.npmjs.org/@atproto/common-web/-/common-web-0.3.0.tgz", ··· 41 56 "zod": "^3.21.4" 42 57 } 43 58 }, 59 + "node_modules/@atproto/common/node_modules/@atproto/common-web": { 60 + "version": "0.2.4", 61 + "resolved": "https://registry.npmjs.org/@atproto/common-web/-/common-web-0.2.4.tgz", 62 + "integrity": "sha512-6+DOhQcTklFmeiSkZRx6iFeqi4OFtGl4yEDGATk00q4tEcPoPvyOBtYHN6+G9lrfJIfx5RfmggamvXlJv1PxxA==", 63 + "license": "MIT", 64 + "dependencies": { 65 + "graphemer": "^1.4.0", 66 + "multiformats": "^9.9.0", 67 + "uint8arrays": "3.0.0", 68 + "zod": "^3.21.4" 69 + } 70 + }, 71 + "node_modules/@atproto/common/node_modules/zod": { 72 + "version": "3.21.4", 73 + "resolved": "https://registry.npmjs.org/zod/-/zod-3.21.4.tgz", 74 + "integrity": "sha512-m46AKbrzKVzOzs/DZgVnG5H55N1sv1M8qZU3A8RIKbs3mrACDNeIOeilDymVb2HdmP8uwshOCF4uJ8uM9rCqJw==", 75 + "license": "MIT", 76 + "funding": { 77 + "url": "https://github.com/sponsors/colinhacks" 78 + } 79 + }, 80 + "node_modules/@atproto/crypto": { 81 + "version": "0.3.0", 82 + "resolved": "https://registry.npmjs.org/@atproto/crypto/-/crypto-0.3.0.tgz", 83 + "integrity": "sha512-bhcxRTL4fgRY2YX/St0x4o0oDUp18QIPD7ek+7v8UKA0HpsCGQYbo8w9d9hUvwwty5X5p00cYF2tbggUWaPy7A==", 84 + "license": "MIT", 85 + "dependencies": { 86 + "@noble/curves": "^1.1.0", 87 + "@noble/hashes": "^1.3.1", 88 + "uint8arrays": "3.0.0" 89 + } 90 + }, 91 + "node_modules/@atproto/identity": { 92 + "version": "0.3.3", 93 + "resolved": "https://registry.npmjs.org/@atproto/identity/-/identity-0.3.3.tgz", 94 + "integrity": "sha512-i5d3eOnXQAXuOrjdm4NcveIBJxdEywYJQ4d74/JOgy27bGdNVFgh9FdZAsOseQRkLv4r7mr0I0C6OlSA2BQIxA==", 95 + "license": "MIT", 96 + "dependencies": { 97 + "@atproto/common-web": "^0.2.4", 98 + "@atproto/crypto": "^0.3.0", 99 + "axios": "^0.27.2" 100 + } 101 + }, 102 + "node_modules/@atproto/identity/node_modules/@atproto/common-web": { 103 + "version": "0.2.4", 104 + "resolved": "https://registry.npmjs.org/@atproto/common-web/-/common-web-0.2.4.tgz", 105 + "integrity": "sha512-6+DOhQcTklFmeiSkZRx6iFeqi4OFtGl4yEDGATk00q4tEcPoPvyOBtYHN6+G9lrfJIfx5RfmggamvXlJv1PxxA==", 106 + "license": "MIT", 107 + "dependencies": { 108 + "graphemer": "^1.4.0", 109 + "multiformats": "^9.9.0", 110 + "uint8arrays": "3.0.0", 111 + "zod": "^3.21.4" 112 + } 113 + }, 44 114 "node_modules/@atproto/lexicon": { 45 115 "version": "0.4.0", 46 116 "resolved": "https://registry.npmjs.org/@atproto/lexicon/-/lexicon-0.4.0.tgz", ··· 73 143 "zod": "^3.21.4" 74 144 } 75 145 }, 76 - "node_modules/@atproto/repo/node_modules/@atproto/common": { 77 - "version": "0.3.4", 78 - "resolved": "https://registry.npmjs.org/@atproto/common/-/common-0.3.4.tgz", 79 - "integrity": "sha512-qjOHcyeHjGRJseYbdnl+0PViDlMRN9GR0/1ToGKAmXh0voz4LbBWU1FwtGF7CvTlbom9MZYhu21lF5pD5RqBwQ==", 80 - "license": "MIT", 81 - "dependencies": { 82 - "@atproto/common-web": "^0.2.4", 83 - "@ipld/dag-cbor": "^7.0.3", 84 - "cbor-x": "^1.5.1", 85 - "iso-datestring-validator": "^2.2.2", 86 - "multiformats": "^9.9.0", 87 - "pino": "^8.15.0", 88 - "zod": "3.21.4" 89 - } 90 - }, 91 146 "node_modules/@atproto/repo/node_modules/@atproto/common-web": { 92 147 "version": "0.2.4", 93 148 "resolved": "https://registry.npmjs.org/@atproto/common-web/-/common-web-0.2.4.tgz", ··· 100 155 "zod": "^3.21.4" 101 156 } 102 157 }, 103 - "node_modules/@atproto/repo/node_modules/@atproto/crypto": { 104 - "version": "0.3.0", 105 - "resolved": "https://registry.npmjs.org/@atproto/crypto/-/crypto-0.3.0.tgz", 106 - "integrity": "sha512-bhcxRTL4fgRY2YX/St0x4o0oDUp18QIPD7ek+7v8UKA0HpsCGQYbo8w9d9hUvwwty5X5p00cYF2tbggUWaPy7A==", 107 - "license": "MIT", 108 - "dependencies": { 109 - "@noble/curves": "^1.1.0", 110 - "@noble/hashes": "^1.3.1", 111 - "uint8arrays": "3.0.0" 112 - } 113 - }, 114 - "node_modules/@atproto/repo/node_modules/@atproto/identity": { 115 - "version": "0.3.3", 116 - "resolved": "https://registry.npmjs.org/@atproto/identity/-/identity-0.3.3.tgz", 117 - "integrity": "sha512-i5d3eOnXQAXuOrjdm4NcveIBJxdEywYJQ4d74/JOgy27bGdNVFgh9FdZAsOseQRkLv4r7mr0I0C6OlSA2BQIxA==", 118 - "license": "MIT", 119 - "dependencies": { 120 - "@atproto/common-web": "^0.2.4", 121 - "@atproto/crypto": "^0.3.0", 122 - "axios": "^0.27.2" 123 - } 124 - }, 125 158 "node_modules/@atproto/repo/node_modules/@atproto/lexicon": { 126 159 "version": "0.3.3", 127 160 "resolved": "https://registry.npmjs.org/@atproto/lexicon/-/lexicon-0.3.3.tgz", ··· 144 177 "@atproto/common-web": "^0.2.4" 145 178 } 146 179 }, 147 - "node_modules/@atproto/repo/node_modules/zod": { 148 - "version": "3.21.4", 149 - "resolved": "https://registry.npmjs.org/zod/-/zod-3.21.4.tgz", 150 - "integrity": "sha512-m46AKbrzKVzOzs/DZgVnG5H55N1sv1M8qZU3A8RIKbs3mrACDNeIOeilDymVb2HdmP8uwshOCF4uJ8uM9rCqJw==", 151 - "license": "MIT", 152 - "funding": { 153 - "url": "https://github.com/sponsors/colinhacks" 154 - } 155 - }, 156 180 "node_modules/@atproto/syntax": { 157 181 "version": "0.3.0", 158 182 "resolved": "https://registry.npmjs.org/@atproto/syntax/-/syntax-0.3.0.tgz", ··· 188 212 "zod": "^3.21.4" 189 213 } 190 214 }, 191 - "node_modules/@atproto/xrpc-server/node_modules/@atproto/common": { 192 - "version": "0.3.4", 193 - "resolved": "https://registry.npmjs.org/@atproto/common/-/common-0.3.4.tgz", 194 - "integrity": "sha512-qjOHcyeHjGRJseYbdnl+0PViDlMRN9GR0/1ToGKAmXh0voz4LbBWU1FwtGF7CvTlbom9MZYhu21lF5pD5RqBwQ==", 195 - "license": "MIT", 196 - "dependencies": { 197 - "@atproto/common-web": "^0.2.4", 198 - "@ipld/dag-cbor": "^7.0.3", 199 - "cbor-x": "^1.5.1", 200 - "iso-datestring-validator": "^2.2.2", 201 - "multiformats": "^9.9.0", 202 - "pino": "^8.15.0", 203 - "zod": "3.21.4" 204 - } 205 - }, 206 215 "node_modules/@atproto/xrpc-server/node_modules/@atproto/common-web": { 207 216 "version": "0.2.4", 208 217 "resolved": "https://registry.npmjs.org/@atproto/common-web/-/common-web-0.2.4.tgz", ··· 215 224 "zod": "^3.21.4" 216 225 } 217 226 }, 218 - "node_modules/@atproto/xrpc-server/node_modules/@atproto/crypto": { 219 - "version": "0.3.0", 220 - "resolved": "https://registry.npmjs.org/@atproto/crypto/-/crypto-0.3.0.tgz", 221 - "integrity": "sha512-bhcxRTL4fgRY2YX/St0x4o0oDUp18QIPD7ek+7v8UKA0HpsCGQYbo8w9d9hUvwwty5X5p00cYF2tbggUWaPy7A==", 222 - "license": "MIT", 223 - "dependencies": { 224 - "@noble/curves": "^1.1.0", 225 - "@noble/hashes": "^1.3.1", 226 - "uint8arrays": "3.0.0" 227 - } 228 - }, 229 227 "node_modules/@atproto/xrpc-server/node_modules/@atproto/lexicon": { 230 228 "version": "0.3.3", 231 229 "resolved": "https://registry.npmjs.org/@atproto/lexicon/-/lexicon-0.3.3.tgz", ··· 248 246 "@atproto/common-web": "^0.2.4" 249 247 } 250 248 }, 251 - "node_modules/@atproto/xrpc-server/node_modules/zod": { 252 - "version": "3.21.4", 253 - "resolved": "https://registry.npmjs.org/zod/-/zod-3.21.4.tgz", 254 - "integrity": "sha512-m46AKbrzKVzOzs/DZgVnG5H55N1sv1M8qZU3A8RIKbs3mrACDNeIOeilDymVb2HdmP8uwshOCF4uJ8uM9rCqJw==", 255 - "license": "MIT", 256 - "funding": { 257 - "url": "https://github.com/sponsors/colinhacks" 258 - } 259 - }, 260 249 "node_modules/@cbor-extract/cbor-extract-darwin-arm64": { 261 250 "version": "2.2.0", 262 251 "resolved": "https://registry.npmjs.org/@cbor-extract/cbor-extract-darwin-arm64/-/cbor-extract-darwin-arm64-2.2.0.tgz", ··· 381 370 } 382 371 }, 383 372 "node_modules/@skyware/firehose": { 384 - "version": "0.1.5", 385 - "resolved": "https://registry.npmjs.org/@skyware/firehose/-/firehose-0.1.5.tgz", 386 - "integrity": "sha512-ggO2xHERcTxnICRGHuha0vad9fQbmzvraRPhSoi7ysnIzSGUMiQVz/c6HrON2svVMZBoeMzTtu9jjRyhio+ckA==", 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==", 387 376 "license": "MPL-2.0", 388 377 "dependencies": { 389 378 "@atproto/repo": "^0.3.7", ··· 529 518 "dependencies": { 530 519 "base64-js": "^1.3.1", 531 520 "ieee754": "^1.2.1" 532 - } 533 - }, 534 - "node_modules/bufferutil": { 535 - "version": "4.0.8", 536 - "resolved": "https://registry.npmjs.org/bufferutil/-/bufferutil-4.0.8.tgz", 537 - "integrity": "sha512-4T53u4PdgsXqKaIctwF8ifXlRTTmEPJ8iEPWFdGZvcf7sbwYo6FKFEX9eNNAnzFZ7EzJAQ3CJeOtCRA4rDp7Pw==", 538 - "hasInstallScript": true, 539 - "license": "MIT", 540 - "optional": true, 541 - "peer": true, 542 - "dependencies": { 543 - "node-gyp-build": "^4.3.0" 544 - }, 545 - "engines": { 546 - "node": ">=6.14.2" 547 521 } 548 522 }, 549 523 "node_modules/bytes": { ··· 1169 1143 "node": ">= 0.6" 1170 1144 } 1171 1145 }, 1172 - "node_modules/node-gyp-build": { 1173 - "version": "4.8.1", 1174 - "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.8.1.tgz", 1175 - "integrity": "sha512-OSs33Z9yWr148JZcbZd5WiAXhh/n9z8TxQcdMhIOlpN9AhWpLfvVFO73+m77bBABQMaY9XSvIa+qk0jlI7Gcaw==", 1176 - "license": "MIT", 1177 - "optional": true, 1178 - "peer": true, 1179 - "bin": { 1180 - "node-gyp-build": "bin.js", 1181 - "node-gyp-build-optional": "optional.js", 1182 - "node-gyp-build-test": "build-test.js" 1183 - } 1184 - }, 1185 1146 "node_modules/node-gyp-build-optional-packages": { 1186 1147 "version": "5.1.1", 1187 1148 "resolved": "https://registry.npmjs.org/node-gyp-build-optional-packages/-/node-gyp-build-optional-packages-5.1.1.tgz", ··· 1621 1582 "license": "MIT", 1622 1583 "engines": { 1623 1584 "node": ">= 0.8" 1624 - } 1625 - }, 1626 - "node_modules/utf-8-validate": { 1627 - "version": "6.0.4", 1628 - "resolved": "https://registry.npmjs.org/utf-8-validate/-/utf-8-validate-6.0.4.tgz", 1629 - "integrity": "sha512-xu9GQDeFp+eZ6LnCywXN/zBancWvOpUMzgjLPSjy4BRHSmTelvn2E0DG0o1sTiw5hkCKBHo8rwSKncfRfv2EEQ==", 1630 - "hasInstallScript": true, 1631 - "license": "MIT", 1632 - "optional": true, 1633 - "peer": true, 1634 - "dependencies": { 1635 - "node-gyp-build": "^4.3.0" 1636 - }, 1637 - "engines": { 1638 - "node": ">=6.14.2" 1639 1585 } 1640 1586 }, 1641 1587 "node_modules/utils-merge": {
+1 -1
package.json
··· 10 10 }, 11 11 "dependencies": { 12 12 "@atproto/api": "^0.12.23", 13 - "@skyware/firehose": "^0.1.5", 13 + "@skyware/firehose": "^0.2.0", 14 14 "dotenv": "^16.4.5" 15 15 } 16 16 }
+5
src/agent.ts
··· 6 6 service: process.env.BSKY_SERVICE ?? "https://bsky.social", 7 7 }); 8 8 9 + await agent.login({ 10 + identifier: process.env.BSKY_IDENTIFIER!, 11 + password: process.env.BSKY_PASSWORD!, 12 + }); 13 + 9 14 return agent; 10 15 }; 11 16
+1 -1
src/label.ts
··· 8 8 9 9 const post = URIs[uri]; 10 10 11 - if (repo.data.labels && post.includes("Like this post to delete")) { 11 + if (repo.data.labels && (post ?? "").includes("Like this post to delete")) { 12 12 await agent 13 13 .withProxy("atproto_labeler", DID) 14 14 .api.tools.ozone.moderation.emitEvent({
+4 -4
src/main.ts
··· 7 7 const subscribe = async () => { 8 8 const agent = await getAgent(); 9 9 10 - //const firehose = new Firehose("wss://bsky.network", { cursor: "759324067" }); 11 - const firehose = new Firehose(); 10 + // add firehose cursor save 11 + const firehose = new Firehose({ cursor: "759165458" }); 12 12 firehose.on("commit", (commit) => { 13 13 for (const op of commit.ops) { 14 14 if (op.action === "delete") continue; 15 15 if (AppBskyFeedLike.isRecord(op.record)) { 16 - if (op.record.subject.uri.includes(DID)) { 17 - if (op.record.subject.uri.includes("app.bsky.feed.post")) { 16 + if ((op.record.subject.uri ?? "").includes(DID)) { 17 + if ((op.record.subject.uri ?? "").includes("app.bsky.feed.post")) { 18 18 label(agent, commit.repo, op.record.subject.uri).catch((err) => 19 19 console.error(err), 20 20 );