By @foldleft.bsky.social, see also Unfollow everyone on twitter.com
This took 10 minutes so is pretty rough.
import { BskyAgent } from "@atproto/api";
// you only need to edit this part
const YOUR_USERNAME = "YOU.bsky.social";
const YOUR_PASSWORD = "yumyum";
const agent = new BskyAgent({
service: "https://bsky.social",
});
await agent.login({
identifier: YOUR_USERNAME,
password: YOUR_PASSWORD,
});
async function deleteBatch() {
const { data } = await agent.getFollows({
actor: YOUR_USERNAME,
limit: 20,
});
if (data.follows.length > 0) {
await Promise.all(
data.follows.map(async (follow) => {
console.log(follow.handle);
if (follow.viewer?.following) {
await agent.deleteFollow(follow.viewer.following);
}
}),
);
deleteBatch();
}
}
deleteBatch();
{
"name": "bluesky",
"description": "",
"version": "0.0.0",
"author": "https://github.com/JamieMason",
"dependencies": {
"@atproto/api": "^0.13.18",
"tsx": "^4.19.2",
"typescript": "^5.7.2"
},
"keywords": [],
"license": "MIT"
}
{
"$schema": "https://json.schemastore.org/tsconfig",
"_version": "22.0.0",
"compilerOptions": {
"lib": ["es2023"],
"module": "node16",
"target": "es2022",
"strict": true,
"esModuleInterop": true,
"skipLibCheck": true,
"moduleResolution": "node16"
}
}