Skip to main content

◈ Automation / AI Content · 2026

Cyber News — AI-Assisted Telegram Newsroom

A Python pipeline that turns 33 security and AI feeds into admin-approved Uzbek Telegram posts

PythonFastAPIaiogramPostgreSQL
Project overview
33 RSS feedsSources
48 hoursFreshness window
Postgres or SQLiteDatabase
22Commits

A Python service that polls 33 cybersecurity, AI and IT feeds, extracts each article's body and lead image, rewrites it into a factual Uzbek post with Gemini, and sends only approved drafts to a Telegram channel. The admin gets a photo or text preview with publish and reject buttons; a protected /scan endpoint is triggered every 15 minutes by GitHub Actions, and the whole bot ships as a Docker image on Koyeb.

// tech stack

PythonFastAPIaiogramPostgreSQLSupabaseGemini APIhttpxBeautifulSoupDockerKoyebGitHub Actions

// 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),
        "",
    ))