NewsBlocks is a simple, visual way to see global news. It gathers headlines from major publishers, groups them into related stories using AI, and displays them as a treemap.
The app runs on an automated pipeline that updates every 8 hours:
- Gather: Scrapes massive RSS feeds from trusted elite sources (BBC, Reuters, FT) and Google Topic Aggregation for maximum data density.
- Filter: Removes non-news content like podcasts, editorial guides, and pricing alerts.
- Group: Uses AI embeddings to cluster similar headlines into a single "story."
- Score: Gemini AI analyzes each story for sentiment (positive/negative) and relevance.
- Clean: If a story only has one source, it's dropped unless it comes from an elite publisher or has a high relevance score.
- Deploy: Updates the dashboard and generates static search-engine-friendly pages for every story.
graph TD
A[RSS Feeds] -->|Scrape| B(Filter out noise)
B -->|Clean Headlines| C(Group stories with AI)
C -->|Story Clusters| D(Score Sentiment & Relevance)
D --> E{Smart Signal Gate}
E -->|Elite Source| F[✅ Keep]
E -->|Multiple Sources| F
E -->|High Importance| F
E -->|Single Source Noise| G[❌ Drop]
F --> H[Update Dashboard]
F --> I[Generate SEO Pages]
- Node.js (v18+)
- A Gemini API Key
git clone https://github.com/prasadabhishek/newsblocks.git
cd newsblocks
npm installCreate a .env file in the root directory:
GEMINI_API_KEY=your_key_here- Development Server:
npm run dev(View at http://localhost:5173) - Data Update:
node scripts/gather-news.js(Manually run the news scraper) - Tests:
npm run test(Run the unit tests)
- Frontend: React + D3.js (Responsive Treemap & Swipeable Mobile UI)
- AI: Google Gemini (Sentiment & Relevance Rankings)
- Aggregator: Massive Source Density (Google News, Reuters, BBC, TechCrunch)
- Persistence: Local JSON caching (improves speed and saves API costs)
- Hosting: Cloudflare Pages + GitHub Actions
For free AI processing, run the pipeline on a local Mac Mini with Ollama instead of GitHub Actions.
- Ollama installed:
ollama serve - Node.js v18+
- GitHub Personal Access Token (for auto-push)
# Clone repo to a shared location
sudo mkdir -p /Users/Shared/news-map
sudo chown $(whoami) /Users/Shared/news-map
git clone https://github.com/prasadabhishek/newsblocks.git /Users/Shared/news-map
cd /Users/Shared/news-map
npm install
# Create logs directory
mkdir -p /Users/Shared/news-map/logs# Create .env with GitHub token
cat > /Users/Shared/news-map/.env << 'EOF'
GITHUB_TOKEN=ghp_your_token_here
RUN_INTERVAL_H=4
AI_PROVIDER=ollama
OLLAMA_HOST=http://localhost:11434
EOF# Copy plist template
cp scripts/com.newsblocks.runner.plist ~/Library/LaunchAgents/
# Edit the plist to set correct paths
# The path in ProgramArguments should match your install location
# Load the service
launchctl load ~/Library/LaunchAgents/com.newsblocks.runner.plist
# View logs
tail -f /Users/Shared/news-map/logs/runner.log# Start/stop the service
launchctl start com.newsblocks.runner
launchctl stop com.newsblocks.runner
# Restart after changes
launchctl unload ~/Library/LaunchAgents/com.newsblocks.runner.plist
launchctl load ~/Library/LaunchAgents/com.newsblocks.runner.plist
# Run once manually
cd /Users/Shared/news-map
node news-runner.js