// tech stack
// the challenge
A one-person news channel has to publish fast without turning into a copy-paste feed. Checking dozens of vendor blogs and security advisories by hand, then rewriting each item into Uzbek, does not fit in a day — and stale articles, duplicates and invented details are constant risks.
// the solution
The service fans out over 33 RSS sources concurrently, keeps only items from the last 48 hours, canonicalises URLs (tracking parameters stripped) and rejects near-duplicates by title similarity against the last 500 posts. Each survivor's page is scraped for body text and an og:image, then Gemini rewrites it under a strict editorial prompt. A quality gate checks length, Uzbek vocabulary, sentence count and banned meta-phrases, and marks anything that fails instead of publishing it. Approved posts go out as photo captions under 1000 characters, with an automatic fallback to text, and finished rows are pruned after 30 days.
// measurable impact
Runs unattended on a free-tier stack: 33 sources scanned every 15 minutes by an Actions cron, drafts waiting for a single tap in the admin chat, and a database that stays small because finished rows expire. Both Postgres (Supabase pooler) and a local SQLite file are supported, so the same code runs on a laptop and in Docker.
- Timeline
- Aug 2026 · 22 commits
- Team
- Solo
- Role
- Backend, bot UX and deployment
// key highlights
- ◆33 RSS sources across cybersecurity, AI and IT, polled concurrently with httpx
- ◆Two-layer dedupe: canonical URLs plus 82% title similarity over the last 500 posts
- ◆Gemini editorial prompt guarded by a quality gate that rejects meta-text and generic advice
- ◆Photo posts up to 1000 characters, automatic fallback to text messages
- ◆Protected /scan endpoint triggered by GitHub Actions every 15 minutes
// implementation sample
@staticmethod
def _canonical_url(value: str) -> str:
parts = urlsplit(value)
query = [
(key, item)
for key, item in parse_qsl(parts.query, keep_blank_values=True)
if not key.lower().startswith("utm_")
and key.lower() not in {"fbclid", "gclid"}
]
return urlunsplit((
parts.scheme.lower(),
parts.netloc.lower().removeprefix("www."),
parts.path.rstrip("/"),
urlencode(query),
"",
))