Mass Block [bsky] Reposts [and more]
0
fork

Configure Feed

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

feat: wire profile mode through filter, summary, and main

Winter 32931954 688a92ec

+28 -15
+28 -15
index.js
··· 511 511 // ── filtering ─────────────────────────────────────────────────────── 512 512 function filterCandidates({ results, did, follows, followers, existingBlocks, blockFollowing }) { 513 513 const allCandidates = new Set(); 514 - for (const src of [results.reposts, results.likes, results.replies, results.authorFollowers]) { 514 + for (const src of [results.reposts, results.likes, results.replies, results.followers, results.following]) { 515 515 for (const d of src) allCandidates.add(d); 516 516 } 517 517 ··· 540 540 } 541 541 542 542 // ── summary display ───────────────────────────────────────────────── 543 - async function showSummary(results, filterResult, categories, blockAuthorFollowers) { 543 + async function showSummary(results, filterResult, categories, mode) { 544 544 const lines = []; 545 - if (categories.has("reposts")) lines.push(` reposters: ${results.reposts.length}`); 546 - if (categories.has("likes")) lines.push(` likers: ${results.likes.length}`); 547 - if (categories.has("replies")) lines.push(` repliers: ${results.replies.length}`); 548 - if (blockAuthorFollowers) lines.push(` author followers: ${results.authorFollowers.length}`); 549 - lines.push(` quote posters (excluded): ${results.quotePosters.length}`); 545 + 546 + if (mode === "post") { 547 + if (categories.has("reposts")) lines.push(` reposters: ${results.reposts.length}`); 548 + if (categories.has("likes")) lines.push(` likers: ${results.likes.length}`); 549 + if (categories.has("replies")) lines.push(` repliers: ${results.replies.length}`); 550 + if (categories.has("followers")) lines.push(` author followers: ${results.followers.length}`); 551 + lines.push(` quote posters (excluded): ${results.quotePosters.length}`); 552 + } else { 553 + if (categories.has("followers")) lines.push(` followers: ${results.followers.length}`); 554 + if (categories.has("following")) lines.push(` following: ${results.following.length}`); 555 + } 556 + 550 557 lines.push(""); 551 558 lines.push(` unique candidates: ${filterResult.total}`); 552 559 if (filterResult.skippedSelf) lines.push(` - ${filterResult.skippedSelf} (self)`); ··· 750 757 const config = await runInteractiveFlow(); 751 758 752 759 const s1 = p.spinner(); 753 - s1.start("resolving post..."); 754 - const atUri = await resolvePostUri(config.postUrl); 755 - s1.stop(`target: ${atUri}`); 760 + let target; 761 + if (config.mode === "post") { 762 + s1.start("resolving post..."); 763 + target = await resolvePostUri(config.url); 764 + s1.stop(`target: ${target}`); 765 + } else { 766 + s1.start("resolving profile..."); 767 + target = await resolveProfileTarget(config.url); 768 + s1.stop(`target: ${target}`); 769 + } 756 770 757 - // resolve identity and fetch engagement data in parallel 758 771 const s2 = p.spinner(); 759 - s2.start("fetching engagement data & resolving identity..."); 772 + s2.start("fetching data & resolving identity..."); 760 773 const [results, did] = await Promise.all([ 761 - fetchEngagementData(atUri, config.categories, config.blockAuthorFollowers), 774 + fetchEngagementData(target, config.categories, config.mode), 762 775 resolveHandle(config.handle), 763 776 ]); 764 - s2.stop("engagement data fetched"); 777 + s2.stop("data fetched"); 765 778 766 779 const s3 = p.spinner(); 767 780 s3.start("fetching your social graph & existing blocks..."); ··· 777 790 process.exit(0); 778 791 } 779 792 780 - await showSummary(results, filterResult, config.categories, config.blockAuthorFollowers); 793 + await showSummary(results, filterResult, config.categories, config.mode); 781 794 782 795 await confirmAndBlock({ 783 796 toBlock: filterResult.toBlock,