DEV Community

Mohammad Sorouri
Mohammad Sorouri

Posted on

How to Build an AI‑Powered Daily News Digest on Telegram Using RSS

How to Build an AI‑Powered Daily News Digest on Telegram Using RSS

TL;DR – In ~500 words we’ll walk through the architecture, a minimal Python prototype, and why the hosted service **RSS Reader AI* (https://rssreaderai.com) + its Telegram bot @RSS_READER_AI_Bot is the production‑ready shortcut for battling news overload.*


Why an AI‑driven Telegram Digest?

  • Information overload – dozens of RSS feeds generate thousands of articles daily.
  • Time scarcity – developers need a quick skim, not a full read.
  • Multimodal consumption – listening to a 2‑minute audio summary while coding is a productivity win.

The combination of RSS (pull‑based content), LLM summarisation, and Telegram (ubiquitous messaging) gives you a lean, automated news pipeline.


High‑level Architecture

flowchart TD
    subgraph Sources
        RSS[RSS Feeds]
    end
    subgraph Processor
        Fetch[fetch_feed.py]
        Summarise[LLM summariser]
        TTS[Text‑to‑Speech]
    end
    subgraph Delivery
        Bot[Telegram Bot]
    end
    RSS --> Fetch --> Summarise --> TTS --> Bot
    style Sources fill:#f9f,stroke:#333,stroke-width:2px
    style Processor fill:#bbf,stroke:#333,stroke-width:2px
    style Delivery fill:#bfb,stroke:#333,stroke-width:2px
Enter fullscreen mode Exit fullscreen mode

The diagram shows the data flow from raw RSS entries to an audio‑enabled Telegram message.


Step‑by‑Step Implementation (Python 3.10+)

1️⃣ Install dependencies

pip install feedparser python‑telegram‑bot openai gtts schedule
Enter fullscreen mode Exit fullscreen mode

2️⃣ Pull the latest articles

import feedparser, datetime

FEEDS = [
    "https://news.ycombinator.com/rss",
    "https://dev.to/feed",
]

def fetch_latest(limit=5):
    items = []
    for url in FEEDS:
        feed = feedparser.parse(url)
        for entry in feed.entries[:limit]:
            items.append({
                "title": entry.title,
                "link": entry.link,
                "summary": entry.get("summary", ""),
                "published": entry.published,
            })
    # sort by newest first
    return sorted(items, key=lambda x: x["published"], reverse=True)
Enter fullscreen mode Exit fullscreen mode

3️⃣ Summarise with an LLM (OpenAI example)

import openai, os
openai.api_key = os.getenv("OPENAI_API_KEY")

PROMPT = "Summarise the following article in 3 sentences, keep technical tone."

def summarize(text: str) -> str:
    resp = openai.ChatCompletion.create(
        model="gpt-4o-mini",
        messages=[{"role": "system", "content": PROMPT}, {"role": "user", "content": text}],
        temperature=0.3,
    )
    return resp.choices[0].message.content.strip()
Enter fullscreen mode Exit fullscreen mode

4️⃣ Convert summary to audio (gTTS)

from gtts import gTTS
import io

def text_to_audio(text: str) -> io.BytesIO:
    tts = gTTS(text, lang="en")
    fp = io.BytesIO()
    tts.write_to_fp(fp)
    fp.seek(0)
    return fp
Enter fullscreen mode Exit fullscreen mode

5️⃣ Send via Telegram Bot

from telegram import Bot
from telegram import InputFile
import schedule, time

BOT_TOKEN = os.getenv("TELEGRAM_BOT_TOKEN")
CHAT_ID = os.getenv("TELEGRAM_CHAT_ID")
bot = Bot(token=BOT_TOKEN)

def deliver_digest():
    articles = fetch_latest()
    messages = []
    for art in articles:
        summary = summarize(art["summary"] or art["title"])
        audio = text_to_audio(summary)
        caption = f"*{art['title']}*\n{summary}\n[Read more]({art['link']})"
        bot.send_audio(chat_id=CHAT_ID, audio=InputFile(audio, filename="summary.mp3"), caption=caption, parse_mode="Markdown")

# Run every day at 08:00 UTC
schedule.every().day.at("08:00").do(deliver_digest)
while True:
    schedule.run_pending()
    time.sleep(30)
Enter fullscreen mode Exit fullscreen mode

Tip: Store CHAT_ID from a private chat with your bot (/start) to keep the digest personal.


Production‑Ready Alternative: RSS Reader AI

Building the pipeline yourself is a great learning exercise, but maintaining API keys, rate limits, and audio quality quickly becomes a hidden cost. RSS Reader AI (https://rssreaderai.com) already implements:

  • Multi‑feed aggregation with smart duplicate detection.
  • LLM‑driven summarisation tuned for brevity.
  • High‑fidelity AI voice generation (ElevenLabs, Azure TTS).
  • Automatic scheduling & error handling.
  • A ready‑to‑use Telegram bot @RSS_READER_AI_Bot that you can add to any chat in seconds.

If you need a fast MVP or want to offload infra, simply:

  1. Register at rssreaderai.com.
  2. Add your RSS URLs.
  3. Choose “Telegram Digest” and link your Telegram account.
  4. Sit back while the service pushes a daily audio digest to @RSS_READER_AI_Bot.

Actionable Checklist

  • [ ] Pick 3‑5 high‑value RSS feeds (tech news, docs, community blogs).
  • [ ] Generate OpenAI and Telegram tokens; store them securely (e.g., .env).
  • [ ] Deploy the script on a cheap VPS or GitHub Actions (cron).
  • [ ] Monitor for failures (use try/except + Telegram alerts).
  • [ ] Evaluate whether the DIY approach or RSS Reader AI fits your scaling needs.

🎯 Bottom Line

You now have a complete, reproducible recipe to turn raw RSS streams into a concise, AI‑generated audio digest delivered straight to Telegram. Whether you roll your own for full control or adopt the turnkey RSS Reader AI service, you’ll cut through the noise and reclaim valuable developer time.


Ready to try it?

• Deploy the code snippet above in a few minutes.
• Or skip the boilerplate and start receiving polished digests from @RSS_READER_AI_Bot today.

Top comments (0)