bsky feeds about music music-atmosphere-feed.plyr.fm/
bsky feed zig
2
fork

Configure Feed

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

tune bot threshold to 100/24h, make configurable via BOT_THRESHOLD env

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

+9 -3
+8 -2
src/server/http.zig
··· 232 232 return; 233 233 } 234 234 } else if (feed_type == .organic) { 235 - // get high-volume posters (>500 posts in last 24h = likely bots) 236 - exclude_dids = posts.getHighVolumePosters(alloc, 500, 24) catch |err| blk: { 235 + // get high-volume posters (default: >100 posts in last 24h = likely bots) 236 + const bot_threshold = getBotThreshold(); 237 + exclude_dids = posts.getHighVolumePosters(alloc, bot_threshold, 24) catch |err| blk: { 237 238 std.debug.print("failed to get high-volume posters: {}\n", .{err}); 238 239 break :blk null; 239 240 }; ··· 258 259 }; 259 260 260 261 try sendJson(request, .ok, result); 262 + } 263 + 264 + fn getBotThreshold() usize { 265 + const val = if (std.c.getenv("BOT_THRESHOLD")) |p| std.mem.span(p) else return 100; 266 + return std.fmt.parseInt(usize, val, 10) catch 100; 261 267 } 262 268 263 269 fn getHeader(request: *http.Server.Request, name: []const u8) ?[]const u8 {
+1 -1
src/store/posts.zig
··· 191 191 \\WHERE author_did IS NOT NULL AND indexed_at > ? 192 192 \\GROUP BY author_did 193 193 \\HAVING cnt > ? 194 - , .{ cutoff_ms, threshold }) catch return error.QueryFailed; 194 + , .{ cutoff_ms, @as(i64, @intCast(threshold)) }) catch return error.QueryFailed; 195 195 defer rows.deinit(); 196 196 197 197 while (rows.next()) |row| {