···11-meow
11+# ATProto following sync
22+33+Sync your following against the source of truth of your choice! Default: bsky
44+55+How to run:
66+77+- make an app password for your ATProto account
88+- clone this repo
99+- `BSKY_HANDLE=your.handle BSKY_PASSWORD=your-app-password bun run index.ts` (or other js engine of choice)
1010+- profit
1111+
+3-3
index.ts
···125125 sourceDids: Set<string>
126126) => {
127127 console.log(`\ndownstream target is ${targetAppName} (${targetCollection})`);
128128-128128+129129 const currentTargetRecords = await fetchAllRecords(targetCollection);
130130 let addedCount = 0;
131131 let deletedCount = 0;
···144144145145 if (SHOULD_DELETE && currentTargetRecords.size > 0) {
146146 console.log(`found ${currentTargetRecords.size} orphans in ${targetAppName}, pruning...`);
147147-147147+148148 let progress = 0;
149149 for (const [did, rkey] of currentTargetRecords) {
150150 progress++;
···179179 });
180180181181 console.log(`\nSOURCE OF TRUTH: ${SOURCE_KEY} (${APPS[SOURCE_KEY]})`);
182182-182182+183183 const sourceMap = await fetchAllRecords(APPS[SOURCE_KEY]);
184184 const sourceDids = new Set(sourceMap.keys());
185185