From 47d257faaf4b03a154ff2156394a4ece7f286bea Mon Sep 17 00:00:00 2001 From: Gigi Date: Tue, 21 Oct 2025 09:01:10 +0200 Subject: [PATCH] feat: add hardcoded bot pubkey filtering --- src/components/BlogPostCard.tsx | 3 ++- src/config/bots.ts | 17 +++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 src/config/bots.ts diff --git a/src/components/BlogPostCard.tsx b/src/components/BlogPostCard.tsx index 355195b0..4542a66c 100644 --- a/src/components/BlogPostCard.tsx +++ b/src/components/BlogPostCard.tsx @@ -6,6 +6,7 @@ import { formatDistance } from 'date-fns' import { BlogPostPreview } from '../services/exploreService' import { useEventModel } from 'applesauce-react/hooks' import { Models } from 'applesauce-core' +import { isKnownBot } from '../config/bots' interface BlogPostCardProps { post: BlogPostPreview @@ -22,7 +23,7 @@ const BlogPostCard: React.FC = ({ post, href, level, readingP const rawName = (profile?.name || profile?.display_name || '').toLowerCase() // Hide bot authors by name/display_name - if (hideBotByName && rawName.includes('bot')) { + if (hideBotByName && (rawName.includes('bot') || isKnownBot(post.author))) { return null } diff --git a/src/config/bots.ts b/src/config/bots.ts new file mode 100644 index 00000000..f319a23f --- /dev/null +++ b/src/config/bots.ts @@ -0,0 +1,17 @@ +import { nip19 } from 'nostr-tools' + +/** + * Hardcoded list of bot pubkeys (hex format) to hide articles from + * These are accounts known to be bots or automated services + */ +export const BOT_PUBKEYS = new Set([ + // Step Counter Bot (npub14l5xklll5vxzrf6hfkv8m6n2gqevythn5pqc6ezluespah0e8ars4279ss) + nip19.decode('npub14l5xklll5vxzrf6hfkv8m6n2gqevythn5pqc6ezluespah0e8ars4279ss').data as string, +]) + +/** + * Check if a pubkey corresponds to a known bot + */ +export function isKnownBot(pubkey: string): boolean { + return BOT_PUBKEYS.has(pubkey) +}