DEV Community

Cover image for I spent a weekend on a bot that turns 40 minutes of feeds into a 40-second digest
zidingyizzz
zidingyizzz

Posted on Edited on

I spent a weekend on a bot that turns 40 minutes of feeds into a 40-second digest

A full round goes like this: phone, news apps, an RSS reader, a couple of group chats, a price page for something you're waiting on. Forty minutes later, maybe three items actually stuck.

The problem wasn't the sources. It was this: 90% of any feed is noise for me specifically, and the 10% worth reading sits in five different apps. Each one wants its five minutes.

So I wrote BriefBot. One YAML file says where to watch, what matters, and where to deliver. Every morning at 8 it sends me one digest. I'm done in 40 seconds. Mine's been going out daily since last week — the same bot, the same config, zero babysitting.

This post is the 5-minute version of getting it running for free on GitHub Actions. No server, no credit card.

What it actually does

Three blocks in one config file:

jobs:
  - name: my-morning
    sources:            # where to watch
      - type: rss
        url: https://hnrss.org/frontpage?points=200
      - type: static_json
        url: https://api.github.com/repos/numpy/numpy/releases
        uid_key: tag_name
        fields: {title: "{tag_name}", date: "{published_at}"}
    digest:             # what to say
      mode: llm         # or "plain" — works with no API key at all
      system_prompt: "Only items relevant to a Python dev. One line each."
    channels:           # where to deliver
      - type: telegram
        bot_token: ${TELEGRAM_BOT_TOKEN}
        chat_id: ${TELEGRAM_CHAT_ID}
Enter fullscreen mode Exit fullscreen mode

That's the whole idea. Sources → state diff → digest → channels. It remembers what it already sent (a small state file), so you only hear about new things — a release, a price drop, a new chapter, whatever you point it at.

page_select watches a plain web page with CSS selectors, so "no API, no RSS" sites work too.

The 5-minute deploy (free tier)

  1. Fork or push the repo — fork briefbot, or push the code into a new private repo if you prefer (GitHub doesn't allow private forks; secrets live in env vars either way).
  2. Copy config.example.yaml to config.yaml, edit the jobs. Start with two sources, not ten.
  3. Add secrets in repo Settings → Secrets and variables → Actions: OPENAI_API_KEY (optional — see below), TELEGRAM_BOT_TOKEN, TELEGRAM_CHAT_ID. A Telegram bot takes 3 minutes with @botfather.
  4. The bundled workflow (.github/workflows/briefbot.yml) runs daily at 08:00 Beijing time and caches .state/ between runs so nothing gets re-sent. Edit the cron: line for your timezone, or fire it once manually from the Actions tab to see it work (on a fresh fork, Actions is disabled until you enable it there).

No API key? Set mode: plain. You get a clean rule-based digest — titles, new-field diffs, no LLM. The LLM part is optional and bring-your-own: any OpenAI-compatible endpoint, including a local Ollama.

Why I trust it with my mornings

  • The whole thing is under 1,000 lines of readable Python with 4 dependencies — you can read every line in one sitting. I don't like black boxes touching my feeds.
  • 36 offline tests, CI green on every push.
  • If one source fails, the job still runs with the rest and logs an error= line. A failed delivery rolls back instead of losing items.
  • In three days of scheduled runs: 9 runs, 0 errors, 99 items deduped across 4 sources.

If you'd rather not set it up at all

There's a one-time $19 launch kit — same code, packaged with walkthrough docs and ready configs. Link's in the repo README. The free path above is complete on its own; the kit is for people who'd rather not fiddle with any of it.


Morning round now: open Telegram, one message, 40 seconds, done. What I do with the other 39 minutes 20 is nobody's business but mine.

What would you point it at? Genuinely curious — the weirdest source ideas make the best configs.

Top comments (2)

Collapse
 
fun_fun_19313eced54af3c68 profile image
SoloAgentFlow •

Rolling back on a failed delivery instead of losing items is a nice touch. Two GitHub Actions gotchas worth a line in the README, since the state lives in the Actions cache: caches that aren't accessed for 7 days get evicted, and in public repos scheduled workflows are disabled after 60 days without repo activity. If the state disappears, the next run sees every item as new and sends a flood, so a guard like "state missing: record this run, don't deliver" (or committing .state/ to a separate branch) would make it safer. To answer your question: I'd point it at the pricing and changelog pages of the SaaS tools I pay for, to catch plan changes before the invoice does.

Collapse
 
zidingyizzz profile image
zidingyizzz •

Both correct, thanks for the detail. They're in the README already, along with the option of committing .state to a branch instead of the cache. The flood is bounded in code: a lost state re-sends at most max_items (30 by default) once, so it's one noisy digest, not the whole feed. Pricing pages is a good one. The plan table barely changes, so when it moves, the diff is worth a look.