Building a Personal News Aggregator with OpenClaw
## Why Build Your Own News Aggregator?
Algorithms decide what news you see. Social media feeds are designed for engagement, not information. Take back control by building a personal news aggregator that fetches exactly what you care about.
## Prerequisites
- OpenClaw installed and running
- Web search skill enabled
- Basic understanding of OpenClaw cron jobs
## Step 1: Define Your News Sources
```javascript
// config/news-sources.js
module.exports = {
topics: [
{ name: 'AI & Machine Learning', query: 'artificial intelligence news today' },
{ name: 'Self-Hosted Software', query: 'self-hosted open source tools 2026' },
{ name: 'Cybersecurity', query: 'cybersecurity threats vulnerabilities today' },
{ name: 'Startup Funding', query: 'startup funding rounds series A B' },
],
maxArticlesPerTopic: 5,
outputFormat: 'markdown'
};
```
## Step 2: Build the Aggregator Skill
```javascript
// skills/news-aggregator/index.js
const sources = require('./config/news-sources');
async function fetchNews(agent) {
const digest = [];
for (const topic of sources.topics) {
// Use OpenClaw's web search capability
const results = await agent.webSearch(topic.query, {
count: sources.maxArticlesPerTopic,
freshness: 'pd' // past day
});
digest.push({
topic: topic.name,
articles: results.map(r => ({
title: r.title,
url: r.url,
snippet: r.description
}))
});
}
return digest;
}
function formatDigest(digest) {
let md = '# Daily News Digest
';
md += new Date().toLocaleDateString() + '
';
for (const section of digest) {
md += '## ' + section.topic + '
';
for (const article of section.articles) {
md += '- **[' + article.title + '](' + article.url + ')**
';
md += ' ' + article.snippet + '
';
}
}
return md;
}
module.exports = { fetchNews, formatDigest };
```
## Step 3: Schedule Daily Delivery
Set up a cron job to deliver your digest every morning:
```javascript
{
name: 'Morning News Digest',
schedule: { kind: 'cron', expr: '0 7 * * *', tz: 'America/Los_Angeles' },
sessionTarget: 'isolated',
payload: {
kind: 'agentTurn',
message: 'Fetch my daily news digest and send it to me'
},
delivery: { mode: 'announce' }
}
```
## Step 4: Add AI Summarization
Don't just aggregate — summarize. Add a step that condenses each article:
```javascript
async function summarizeArticle(agent, url) {
const content = await agent.webFetch(url, { maxChars: 5000 });
// Agent summarizes the article in 2-3 sentences
return agent.summarize(content, { maxSentences: 3 });
}
```
## Step 5: Save to Your Knowledge Base
Store digests for future reference:
```javascript
const fs = require('fs');
const path = require('path');
function saveDigest(markdown) {
const date = new Date().toISOString().split('T')[0];
const dir = path.join(process.env.HOME, '.openclaw/workspace/news');
fs.mkdirSync(dir, { recursive: true });
fs.writeFileSync(path.join(dir, date + '.md'), markdown);
}
```
## Advanced: Topic Alerts
Get notified immediately when breaking news matches your interests:
```javascript
const ALERT_KEYWORDS = ['security breach', 'zero-day', 'acquisition', 'IPO'];
function checkAlerts(articles) {
return articles.filter(a =>
ALERT_KEYWORDS.some(kw => a.title.toLowerCase().includes(kw))
);
}
```
## Troubleshooting
**No results?** Check that web_search is enabled in your OpenClaw config.
**Stale news?** Adjust the `freshness` parameter — `pd` (past day), `pw` (past week).
**Too noisy?** Reduce `maxArticlesPerTopic` or be more specific with queries.
## Next Steps
- [Automating Twitter with OpenClaw](/post/automating-twitter-how-to-build-an-ai-social-media-manager-with-openclaw)
- [Voice control with Whisper API](/post/voice-control-integrating-whisper-api-for-verbal-commands-on-openclaw)
- [The future of AI agents](/post/the-future-of-ai-agents-why-openclaw-is-the-operating-system-of-tomorrow)