import { AtpAgent } from "@atproto/api"; import { BSKY_APP_PASSWORD, BSKY_USERNAME, PDS_URL } from "./constants"; const agent = new AtpAgent({ service: PDS_URL, }); await agent.login({ identifier: BSKY_USERNAME, password: BSKY_APP_PASSWORD, }); const file = Bun.file("follows.json"); const unfollows = (await file.json()) as { did: string; lastPost: number; uri: string; }[]; for (const [index, unfollow] of unfollows.entries()) { if (unfollow.lastPost === -1 || unfollow.uri === "") { // will figure something out later for this continue; } console.clear(); console.info( `unfollowing ${unfollow.did} [${index + 1} / ${unfollows.length}]`, ); await agent.deleteFollow(unfollow.uri); }