Standalone command-line tool to fetch RSS/Atom feeds and output structured YAML.
Install
Global (permanent, available everywhere):
npm install -g rss2yaml
Run without installing (via npx):
npx -y rss2yaml --urls "https://techcrunch.com/feed/"
From source (clone the repo):
git clone https://github.com/YOUR_USER/rss2yaml.git
cd rss2yaml
npm install
node rss2yaml.js --urls "https://hnrss.org/frontpage" --limit 5
Usage
npx -y rss2yaml --urls "https://techcrunch.com/feed/"
rss2yaml --urls "https://techcrunch.com/feed/" --fields title,description,url,date --limit 10 --sort newest
One-liner examples (copy-paste friendly)
Fetch Reddit AI news, save to file:
rss2yaml --urls "https://www.reddit.com/search.rss?q=ai+models+news&sort=hot" --fields title,description,url,date --limit 10 --sort newest --out feed-news.yaml
Multiple feeds, filter by keyword:
rss2yaml --urls "https://techcrunch.com/feed/,https://hnrss.org/frontpage" --fields title,url,date --limit 5 --sort newest --filter "openai"
Print to stdout (pipe to another tool):
rss2yaml --urls "https://hnrss.org/frontpage" --fields title,url --limit 20 --no-dedupe
Google News
Google News RSS feeds return redirect URLs instead of the real article links. rss2yaml automatically decodes them to the original website URL using google-news-url-decoder.
rss2yaml --urls "https://news.google.com/rss/search?q=openai" --fields title,url,date --limit 5
Output will contain the real article URLs (e.g. https://techcrunch.com/...) instead of https://news.google.com/rss/articles/... redirects.
Google News search tips:
| Simple keyword | https://news.google.com/rss/search?q=openai |
| Multiple keywords | https://news.google.com/rss/search?q=ai+openai |
| Restrict to a site | https://news.google.com/rss/search?q=ai+openai+site:youtube.com |
| Exclude a site | https://news.google.com/rss/search?q=openai+-site:reddit.com |
| Exact phrase | https://news.google.com/rss/search?q="artificial+intelligence" |
| Language/region | https://news.google.com/rss/search?q=openai&hl=fr&gl=CA |
Filter tips
The --filter flag does a simple substring match (case-insensitive). For short keywords like "AI", add spaces around it to avoid matching words like "email", "daily", "train", etc.:
rss2yaml --urls "https://hnrss.org/frontpage" --filter "ai"
rss2yaml --urls "https://hnrss.org/frontpage" --filter " AI "
Flags
--urls, --url | Comma-separated feed URLs (required) | — |
--fields | Fields to extract: title, description, url, date, author | title,description,url,date |
--limit | Max items per feed | 10 |
--sort | Sort order: newest, oldest, none | newest |
--dedupe | Dedup strategy: url, title, url_or_title, none | url_or_title |
--no-dedupe | Disable deduplication | dedupe is ON |
--filter | Keep only items matching this keyword | off |
--keep-html | Keep HTML in text fields | HTML stripped |
--json | Output JSON instead of YAML | YAML |
--cache <sec> | Cache TTL in seconds | 300 (5 min) |
--no-cache | Skip cache, force fresh fetch | cache is ON |
--out | Write output to file (omit to print to stdout) | stdout |
--help | Show help message | — |
Output format
total_items: 5
items:
- source_feed: TechCrunch
title: Some Article
description: Brief summary here
url: https://example.com/article
date: '2025-07-30T12:00:00.000Z'
Notes
- Works with
node (v18+) or bun.
- Google News URLs are automatically decoded to the real article URL (via
google-news-url-decoder).
- Reddit feeds use a specific User-Agent to avoid rate limiting.
- HTML tags are stripped from text fields by default. Use
--keep-html to preserve them.
- Feeds are cached locally (
.rss-cache/) for 5 minutes by default. Use --no-cache to force a fresh fetch, or --cache 600 to change the TTL.