| Post Reply | RetroFed Forum Forum Index » PumpkinDrama |
| Author | Message | ||
|---|---|---|---|
♠️ Critical Nexus ✊🏿
reddthat.com
PumpkinDrama@reddthat.comJoined: 2023-09-23 |
How To Build Our Own Bluesky Custom FeedA technical walkthrough of running a real, programmatic Bluesky feed generator from scratch — the same setup that serves thousands of scored posts to a curated community. What This IsBluesky lets third parties publish custom feeds. A feed generator is just a web service that answers a few HTTP endpoints and returns ranked lists of post URIs. The ranking logic is entirely up to you. This is the story of how we built ours: a stdlib-only Python service, running on a home server behind a Cloudflare Tunnel, serving 8 different engagement-ranked feeds from a curated list of accounts. If you want to build something similar — for your own community, your own interests, your own rules — this is the guide. Why Not Skyfeed?Skyfeed is a no-code web tool for building feeds. It's fine for simple rules (posts containing X, from author Y). But it can't score posts by engagement, filter by repost ratios, rank by velocity, or maintain state across refreshes. If you want a feed that understands "popular" the way a human curator does — weighting likes, reposts, quotes, replies, age, and the ratio between them — you need to write code. Architecture at a Glance
The service exposes four endpoints:
Everything else is scoring logic. Prerequisites
Step 1: The Feed Generator CoreThe entire service is a single Python file using only the standard library. No frameworks, no databases, no dependencies. The main loop:
ScoringEach feed can have its own scoring weights:
For a "trending" feed, we divide by age in hours to surface fast-rising posts:
FilteringEach feed defines its own thresholds:
The repost-share rule is the key differentiator: it ensures posts are not just liked but actively shared, which dramatically improves feed quality. Dedup StateA JSON file ( The state file is written next to the script and persists across restarts. Step 2: ConfigurationAll settings live in a separate
Secrets (handle + app password) go in Step 3: Running as a ServiceA systemd user unit keeps it alive:
The Step 4: Exposing to BlueskyBluesky needs to reach your feed over HTTPS. Cloudflare Tunnel is the easiest path:
No ports opened, no SSL certificates to manage. Step 5: PublishingOnce the endpoints work publicly, you register the feed with Bluesky using What We LearnedThe repost-share ratio is everythingA post with 100 likes and 2 reposts is not "popular" — it's agreeable. A post with 50 likes and 20 reposts is being actively shared. The ratio between them is the signal that separates noise from signal. We require reposts ≥ 1/3 of likes. This is strict — it means our 4h feed might only have 15-20 posts on a quiet day. That's intentional. The longer windows (week, month, 4 months) fill up because the threshold has more data to work with. Dedup is feed-level, not user-levelBluesky's For a single-curator feed (where everyone wants the same view), this works fine. For true per-user dedup, Bluesky would need to pass the requesting user's identity to the feed generator. State persistence is criticalWithout a state file, every restart would re-serve the same top posts. The JSON state file (one array of URIs per feed) is simple, inspectable, and survives restarts. Ours is ~90KB for 1200 tracked posts. Member enumeration is the bottleneckWe fetch 700+ members, then for each one fetch their recent posts. This is ~700 API calls per refresh. We use a thread pool (10 workers) to parallelize, but it still takes ~60 seconds. The Bluesky AppView API handles it fine at our scale (every 10 minutes), but if your list has thousands of members, you'll need to be smarter about which accounts to scan. The CodeThe entire feed generator is ~360 lines of Python. No dependencies. No database. No framework. You can read the full source at [link to your repo]. Adapting This for Your Own FeedThe pattern generalizes:
The scoring function is where your feed's personality lives. Spend your time there. |
||
| 3 Original | |||
| Post Reply |
Back to top |