← Back to Plugins
Tools

Newsroom

bintangtimurlangit By bintangtimurlangit 👁 4 views ▲ 0 votes

Your agent's news desk. RSS feeds, push or digest alerts, presets included, and on-demand briefings.

GitHub

Install

npm install

#

Configuration Example

newsroom_enable_preset({ presetId: "techcrunch" })
newsroom_enable_preset({ presetId: "bbcnews" })

README

# Your agent shouldn’t miss the story. **Newsroom** is the news desk for OpenClaw.

**Stop treating RSS like homework.** Newsroom wires **real feeds** into **real sessions**—so your OpenClaw agent gets breaking items, digests, or on-demand briefings **without** you pasting URLs into chat all day.

- **Push what matters** — New articles can hit your agent as **system events** in the session you pick (same session-key model you already use in OpenClaw).
- **Dial the noise** — Per feed: **instant** alerts, **periodic** digests, or **manual** fetch only.
- **Preset + custom** — One-click sources (BBC, Hacker News, TechCrunch, …) **plus** any RSS URL you care about.
- **No duplicate spam** — SQLite-backed tracking remembers what was already sent.

Built as a **native OpenClaw plugin**: tools your agent can call, a gateway scheduler that does the polling, and a **`newsroom-setup`** CLI so “where should pushes go?” isn’t a config archaeology project.

**Full reference:** [Documentation](./docs/README.md) (installation, configuration, tools, CLI, architecture, development).

---

## Installation

```bash
openclaw plugins install @bintangtimurlangit/newsroom
openclaw gateway restart
```

The CLI and gateway come from the **`openclaw`** package. Install that with **npm**, **pnpm**, **bun**, or another Node-compatible client. **Homebrew** (or similar) may ship **OpenClaw** itself; this plugin is an **npm package** loaded via `openclaw plugins install`, not a separate brew formula unless you maintain one.

### First-time setup (where pushes go)

Newsroom needs an **OpenClaw session key** so `enqueueSystemEvent` can deliver new-article alerts to the right agent session (same idea as the session/channel key you use elsewhere in OpenClaw).

**Resolution order** (first match wins):

1. `plugins.entries.newsroom.config.notificationSessionKey` in `openclaw.json`
2. Environment variable **`NEWSROOM_NOTIFICATION_SESSION_KEY`**
3. Local **`setup.json`** under your state dir: `<stateDir>/plugins/newsroom/setup.json` (written by the command below)

**Interactive setup** (writes `setup.json` and, by default, merges into `openclaw.json`):

```bash
openclaw newsroom-setup
# or non-interactive:
openclaw newsroom-setup --session-key main
```

Before updating **`openclaw.json`**, the setup command checks that the **`openclaw` npm package** is resolvable from the plugin (same install graph as a normal OpenClaw install). If you only have the plugin sources without OpenClaw next to it, use **`--no-write-config`** to write **`setup.json`** only, or install OpenClaw first.

Use **`--no-write-config`** to only write `setup.json` (no change to `openclaw.json`). **Restart the gateway** after changing config so the plugin reloads merged settings.

**Dedicated agent:** OpenClaw does not expose a stable “create agent” API for third-party plugins. If you want a separate agent for news only, add or onboard an agent using OpenClaw’s usual flows (onboarding / agent entries in config), note that agent’s session key, then run **`newsroom-setup`** with that key.

---

## Features

- **Multiple RSS feeds** — Add as many custom feeds as you need.
- **Preset feeds** — Enable popular sources in one step (TechCrunch, BBC News, Hacker News, etc.).
- **Notification modes** — **Auto** (immediate when new items arrive), **periodic** (batched on a schedule), **manual** (on-demand via tools only).
- **Per-feed settings** — Configure each feed independently.
- **Content modes** — Full article text or headline + summary + link.
- **Deduplication** — SQLite-backed tracking avoids sending the same article twice.
- **Background polling** — Scheduler runs for **auto** and **periodic** feeds while the gateway is up.

---

## Usage (agent tools)

### Enable preset feeds

```javascript
newsroom_enable_preset({ presetId: "techcrunch" })
newsroom_enable_preset({ presetId: "bbcnews" })
```

### Add a custom RSS feed

```javascript
newsroom_add_feed({
  url: "https://example.com/feed.xml",
  name: "My Custom Feed",
  notificationMode: "periodic", // "auto", "periodic", or "manual"
  contentMode: "summary", // "full" or "summary"
  periodicIntervalHours: 12,
})
```

### List configured feeds

```javascript
newsroom_list_feeds()
```

### Fetch news on demand

```javascript
newsroom_get_news()
newsroom_get_news({ feedId: 1 })
```

### Update feed settings

```javascript
newsroom_update_feed_settings({
  feedId: 1,
  notificationMode: "auto",
  contentMode: "full",
})
```

### Disable a preset or remove a feed

```javascript
// Preset feeds: disable by feed id from newsroom_list_feeds
newsroom_disable_preset({ feedId: 1 })
// Any feed (including custom):
newsroom_remove_feed({ feedId: 1 })
```

### Feed status

```javascript
newsroom_get_feed_status()
```

**Parameter details and tool list:** [docs/tools.md](./docs/tools.md).

---

## Preset feeds

| Category | Name | Preset ID |
|----------|------|-----------|
| Tech | TechCrunch | `techcrunch` |
| Tech | Ars Technica | `arstechnica` |
| Tech | The Verge | `theverge` |
| News | BBC News | `bbcnews` |
| News | Reuters | `reuters` |
| News | AP News | `apnews` |
| AI/Tech | Hacker News | `hn` |
| AI/Tech | AI Weekly | `aiweekly` |
| General | NPR | `npr` |
| General | Al Jazeera | `aljazeera` |

---

## Configuration

Plugin options live under **`plugins.entries.newsroom.config`**. Defaults apply when fields are omitted.

| Field | Description |
|-------|-------------|
| `pollingIntervalMinutes` | How often the gateway polls **auto** feeds (1–60). |
| `defaultNotificationMode` | Default for new feeds: `auto`, `periodic`, or `manual`. |
| `defaultPeriodicIntervalHours` | Default hours between **periodic** batches (1–168). |
| `defaultContentMode` | `summary` or `full` for new feeds. |
| `notificationSessionKey` | **Recommended for push alerts:** OpenClaw session key that receives **system events** when new articles arrive (auto/periodic). Without this, new-article text is only written to the plugin log. Use the same session key as the agent (see OpenClaw session docs). You can also set **`NEWSROOM_NOTIFICATION_SESSION_KEY`** or run **`openclaw newsroom-setup`** instead of editing JSON by hand. |

```json
{
  "plugins": {
    "entries": {
      "newsroom": {
        "enabled": true,
        "config": {
          "pollingIntervalMinutes": 5,
          "defaultNotificationMode": "periodic",
          "defaultPeriodicIntervalHours": 12,
          "defaultContentMode": "summary",
          "notificationSessionKey": "YOUR_SESSION_KEY_HERE"
        }
      }
    }
  }
}
```

More detail: [docs/configuration.md](./docs/configuration.md).

---

## Development

```bash
# Install dependencies (use pnpm in the OpenClaw monorepo, or npm in a standalone clone)
npm install

# If better-sqlite3 fails to compile on Windows, install without scripts and rely on tests' in-memory DB mock:
npm install --ignore-scripts

# Inside the OpenClaw monorepo, use pnpm and set devDependency "openclaw": "workspace:*" instead of a version.

npm run build
npm test
npm run test:coverage
```

### Native SQLite (`better-sqlite3`) vs unit tests

| Environment | Database |
|-------------|----------|
| **`npm test` / CI** | In-memory mock — **no** native `better-sqlite3` required. |
| **OpenClaw gateway / sandbox** | Real **SQLite** via `better-sqlite3` — the **native addon must compile or load** for the plugin to start. |

`npm install --ignore-scripts` only helps **local development** when you cannot compile (tests still pass); it does **not** produce a plugin that loads in OpenClaw until the native module is built.

**If the plugin fails to load on Windows** (missing `.node` binary / load error): install [Visual Studio Build Tools](https://visualstudio.microsoft.com/visual-cpp-build-tools/) with the **Desktop development with C++** workload, then from this repo run `npm rebuild better-sqlite3`, or reinstall without `--ignore-scripts`. Alternatives: use **WSL** or **Linux**, or run against the **OpenClaw monorepo** where dependencies are linked and toolchains often match CI.

Full guide: [docs/development.md](./docs/development.md).

## Contributing & security

[CONTRIBUTING.md](./CONTRIBUTING.md) · [SECURITY.md](./SECURITY.md) · [Code of Conduct](./CODE_OF_CONDUCT.md)

**GitHub repository description:** use the one-liner in [`package.json`](./package.json) (`description` field) or copy [`.github/REPOSITORY_DESCRIPTION.txt`](./.github/REPOSITORY_DESCRIPTION.txt) into **Settings → General → Description** (≤350 characters).

## License

[MIT](./LICENSE)
tools

Comments

Sign in to leave a comment

Loading comments...