Skip to content

Latest commit

 

History

19 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Python Linux License MIT

NewsCaptain

An automated, AI-powered daily news intelligence briefing designed seamlessly for Newsboat (or any terminal/desktop RSS workflow).

NewsCaptain updates your local RSS feeds, filters out noise (celebrity gossip and other irrelevant news), synthesizes high-impact national/international affairs and local developments using Google Gemini AI, and formats a clean XML briefing delivered straight to your Newsboat interface with daily desktop notifications.


Features

  • AI Noise-Filtering: Evaluates feeds based on a customizable prompt matrix (prioritizes high-impact tech, geopolitical, economic, and regional news).
  • Newsboat First-Class Integration: Embeds natively into Newsboat using local filter:cat feed definitions.
  • Automated Daily Runs: Powered by Systemd timers to execute strictly once a day on first boot.
  • Terminal Friendly: Formatted for lightweight, fast scanning inside terminal emulators.
  • Privacy-Aware & Flexible: Keeps local state in SQLite and parses raw content clean using trafilatura.

Repository Structure

NewsCaptain/
├── systemd/
│   ├── newscaptain.service  # Systemd user service unit template
│   └── newscaptain.timer    # Daily execution timer
├── newscaptain.py           # Core Python engine (DB extraction, Gemini synthesis, XML rendering)
├── newscaptain_daily.sh     # Main Shell wrapper script
├── requirements.txt         # Lightweight Python dependencies
├── LICENSE                  # MIT License
└── README.md

Installation & Setup

  1. Clone the Repository
git clone https://github.com/your-username/NewsCaptain.git
cd NewsCaptain
  1. Set Up Virtual Environment & Dependencies
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
  1. Configure Gemini API Key

Obtain an API key from Google AI Studio and export it, or set it directly in your environment/service.

export GEMINI_API_KEY="your-api-key"

Newsboat Integration

To view the generated AI Briefing directly inside Newsboat, add the following entry to your ~/.config/newsboat/urls configuration file:

"filter:cat ~/.config/newsboat/ai_feed.xml" "Summary" "News"

Make sure your newscaptain.py outputs the generated HTML briefing to ~/.config/newsboat/ai_feed.xml (or your configured output directory).


Automated Daily Execution (Systemd)

NewsCaptain includes Systemd unit files to automatically update feeds and build your briefing once a day on your first system boot.

  1. Create the user Systemd directory (if it doesn't exist):
mkdir -p ~/.config/systemd/user
  1. Copy the unit files from the repository:
cp systemd/newscaptain.* ~/.config/systemd/user/
  1. Edit ~/.config/systemd/user/newscaptain.service to update your path and set your GEMINI_API_KEY:
[Unit]
Description=Updates Newsboat & Generates AI Summary
After=network-online.target
Wants=network-online.target

[Service]
Type=oneshot
Environment="GEMINI_API_KEY=YOUR_GEMINI_API_KEY_HERE"
ExecStart=/home/<username>/.config/newscaptain_daily.sh

[Install]
WantedBy=default.target
  1. Enable and start the daily timer:
systemctl --user daemon-reload
systemctl --user enable --now newscaptain.timer

Manual Execution

You can run the wrapper manually at any time to test or trigger an immediate refresh:

chmod +x newscaptain.sh
./newscaptain.sh

License

This project is open-source and available under the MIT License.

About

AI-powered RSS feed curator for Newsboat that filters clutter and generates smart daily news summaries using Google Gemini.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages