← Back to Articles
Engineering 10 min read

A News Agent That Updates Itself, for Free

A live AI and data news feed that refreshes twice a day with no server, no database and no paid API. How it is built, and the rules that keep it from breaking the site.

The Live Feed on this site refreshes itself twice a day. Nobody presses a button. There is no server, no database, no API key and no bill: free RSS feeds, a little Python, and GitHub Actions on a schedule.

I built it working with Claude Code: I decided what the agent should do, what counts as news here and what it must never do, and I reviewed every pull request. Claude Code wrote and ran most of the code and the tests with me. This is how it works, and the lessons that came from running it every day.

The shape: two repos and a schedule

The agent lives in its own repository, separate from the website. That split is the first design decision:

  • The website repo holds pages and data files. The agent only ever writes a few of them: the news array in js/data.js, a 7-day history file, and a couple of archive files.
  • The agent repo holds the code, the feed list, the tests and the workflows. A change to how news is chosen goes through a pull request and CI here, never on the site.

Twice a day, at 05:00 and 15:00 UTC, a GitHub Actions workflow checks out both repos, runs the agent, and pushes the changed files back to the website, which redeploys. If nothing changed, it commits nothing.

A diagram of the pipeline: RSS feeds flow into fetch and filter, then categorize and balance, then write data.js and the history file, then a commit and push to the website repo, all triggered by a GitHub Actions schedule
The whole agent: a scheduled job that reads feeds and writes two files

Step 1: pick sources you can read for free

Everything starts with a list of feeds in one config file. Each entry is a URL, a default category, and a few settings:

{"url": "https://example.com/feed.rss", "default_category": "data"}

The parsing is done by feedparser, which reads RSS and Atom. It and certifi (for SSL on a Mac) are the only runtime dependencies.

Not every source offers a feed, and some that do are not useful as they are:

  • Release notes titled by date or version. "v2.1.278" tells a reader nothing. The agent titles a release by its first real change instead, for example "Claude Code new release: Added AGENTS.md support (+86 more changes)", and keeps the version in the link.
  • No RSS at all. Snowflake has none, so a small parser reads the "Recent feature updates" list from the docs page and skips features dated in the future.
  • A page that blocks scripts. OpenAI's ChatGPT release notes page returns HTTP 403 to scripts, so the agent reads OpenAI's news feed instead and keeps only Product items that mention ChatGPT.

Test a feed before you add it: does it answer, does it have entries, when was the last one? Several popular blog feeds I tried returned 404 or 406.

Step 2: filter hard, and match whole words

Most of what a feed publishes is not news for this audience. Each feed gets a mode that says how strict to be:

  • all: an on-topic source like the dbt or Databricks blog. Every recent item is kept.
  • strict: broad news like TechCrunch AI or Hacker News. An item needs a technical data term; a bare "AI" is not enough, which drops consumer and political AI stories.
  • startup: funding news. The title needs a funding signal (raises, Series A, a dollar amount) and the item must be about AI or data work.

Then an age filter: anything older than 3 days is dropped (slow newsletters get a longer window, or they would never show).

The most instructive bug in the whole project was here. Keywords first matched as plain substrings, so ai matched "Spain", "brain" and "said". Nearly every item passed the filter and nearly every item was labelled AI. The fix is to match whole words only, still allowing a plural. The idea, in a few lines of Python:

pattern = r"\bai(?:s|es)?\b"
re.search(pattern, "spain")       # None: not inside another word
re.search(pattern, "ai agents")   # a match

A keyword that ends in - matches as a prefix, so gpt- still catches gpt-5. The lesson is general: when a filter lets almost everything through, it is not filtering, and the number of dropped items is the thing to review after any change.

Step 3: categorize and balance

Each item is scored against a keyword list per category (ai, data, trends, tools, startups) and gets the highest score. Some feeds fix their category instead, for example every release-notes feed is tools.

Scoring alone gives a lopsided feed, so the agent balances it: 20 items, an equal quota per category, and leftover slots filled by the freshest items. It also caps each feed at 3 items per run. That cap exists because one YouTube channel once posted five near-identical videos and filled the feed by itself. The same funding round reported by two outlets is shown once (company plus amount).

Step 4: write to the site without breaking it

The website keeps its news in a JavaScript array. The agent replaces just that block with a regex and leaves the rest of the file alone:

pattern = r"const NEWS_ITEMS\s*=\s*\[.*?\];"
updated = re.sub(pattern, new_block, content, flags=re.DOTALL)

If the pattern does not match, it writes nothing and says so in the log. A second file keeps a rolling 7-day history (deduplicated by URL, capped at 200 items) for the "this week" panel.

The most important line in the agent is a guard:

if len(items) < MIN_ITEMS:   # 5
    print("Too few to update safely. Keeping existing feed.")
    sys.exit(0)

When feeds go down, an unguarded agent writes an empty feed to a live site. This one keeps yesterday's news instead. It is on the project's do-not-modify list.

Step 5: schedule it with GitHub Actions

The workflow is short. The key parts:

on:
  schedule:
    - cron: '0 5 * * *'
    - cron: '0 15 * * *'
  workflow_dispatch:
  push:
    branches: [main]

workflow_dispatch adds a manual "Run workflow" button. The push trigger means a merged change shows on the site right away instead of at the next run. It cannot loop, because the job pushes to the other repo, never back to this one.

The built-in GITHUB_TOKEN works for the repo the workflow lives in, not for a second one, so pushing to the website needs a fine-grained personal access token limited to that one repo with Contents read and write, stored as a repository secret. The workflow checks the secret is set before doing anything else, so an expired token fails loudly at the first step. The commit step stages only the files the agent owns and commits only when the diff is not empty.

Two gotchas worth knowing:

  • Scheduled runs can be delayed under high load, especially at the start of an hour. Schedule off the hour (the weekly jobs here run at 07:17) when the exact time matters.
  • "Re-run" in the Actions tab replays the original commit, not the latest code. To get a fresh run, trigger the workflow again on main.

Lesson: keep it free on purpose

"Free" is easy at the start and easy to lose later: one paid API, one hourly cron, one new secret. So it is a test. test_free_only.py fails CI on a new dependency, an unknown secret, a paid-API address or key, a feed URL with a key in it, or an hourly schedule. Any of those becomes a cost decision for me, not something that slips in with a feature.

Measured usage is about 78 Actions minutes per 30 days, well inside the free usage GitHub includes for a private repo on a free account (listed on its Actions billing page; for public repositories, standard runners are free).

There is no LLM in this agent. Categories come from keywords, and the weekly tools digest quotes the release notes' own first sentences. It is deterministic, cheap, and when it gets something wrong I can find the exact rule that did it.

Lesson: feeds die quietly, so check them

A dead feed does not throw an error in the daily run. It just stops contributing, and you notice weeks later that a source is gone. A separate weekly workflow reports every feed as ok, blocked (403 or 429), dead, empty or stale (no new entry in 60 days), and a failed run emails me. Its first run found a research blog whose feed had stopped. It was added after a manual check of every feed turned up a feed returning 404, a blog with no post in over a year, and Reddit feeds that answer 429 to GitHub's runners; the weekly check would have caught those on its own.

It is deliberately not part of PR CI: a feed breaking somewhere on the internet should not block an unrelated merge.

Lesson: automate the boring part, propose the judgment call

The news feed pushes straight to the site, because it is deterministic filtering of sources I already chose. Two later jobs are different. Twice a week, one searches Google News for funding and launch headlines about companies in my field, and another searches Show HN for new tools. Both pull a name out of a headline, and that is imprecise: an investor or a product name can slip in.

So those jobs never change anything themselves. They open a pull request with the headlines as evidence, and I merge, edit or close it. They open nothing when there is nothing new, nothing while an earlier proposal is still open, and they remember what they proposed in the last 120 days through a marker in the PR body, so a rejected name does not come back every week. One detail that is easy to miss: a PR opened by the workflow's token does not trigger other workflows, so CI never runs on it. The job runs the tests itself before it opens the PR. Opening PRs from Actions also needs one repository setting, Allow GitHub Actions to create and approve pull requests.

Lesson: test the whole run, twice

Unit tests cover the pieces: keyword matching, categorizing, title cleaning. The most useful test runs the whole agent end to end, offline, against a temporary copy of the website folder. It checks every file the agent writes, that too few items leave the site untouched, and that a second identical run changes nothing. That last check is what keeps the site's history from filling with empty "refresh" commits.

The takeaway

An auto-updating agent is a small scheduled pipeline, and the hard part is not fetching news. It is deciding what the agent must never do: never wipe the feed, never cost money, never add a judgment call without a person approving it. Write those rules down as guards and tests first, and the rest is plain Python and a cron line.

Further reading