This Python script fetches the latest Google News RSS headlines for a user-supplied list of topics and sends a nicely formatted email digest. It uses Google Gemini to prioritize headlines. Designed to run daily using cron
on any Unix-based system.
How It Works
- History Tracking
Sent articles are stored locally to prevent duplicates in future emails. - Fetch Articles
For each user-defined topic, NewsBot pulls recent headlines using Google News RSS. - Filter Old Content
Headlines that have appeared in recent digests are skipped to avoid repetition. - User Preferences
The user provides a list of topics and keywords, each with a score from 1 to 5 indicating importance. Thereβs also support for banned or demoted topics. - Prioritization with Gemini
Headlines are passed to Gemini, which selects a small set of topics and headlines based on the userβs ranked preferences. - Email Digest
The selected headlines are formatted into an HTML email and sent via SMTP.
Example Digest
Donald Trump
π° Trump orders reopening of notorious Alcatraz prison – BBC
π
Mon, 05 May 2025 04:03 AM EDT
Trade War
π° Strategists optimistic on China even as US-China trade war climbdown looks far off – Reuters
π
Mon, 05 May 2025 05:22 AM EDT
Financial Markets
π° Asian Currencies Jump on Weaker Dollar, Oil Falls: Markets Wrap – Bloomberg.com
π
Mon, 05 May 2025 03:24 AM EDT
Inflation
π° Swiss Inflation Drops to Zero as SNB Mulls More Interest Rate Cuts – Bloomberg.com
π
Mon, 05 May 2025 02:30 AM EDT
Russia
π° Russia reports Ukrainian drone attack on Moscow ahead of May 9 events – Al Jazeera
π
Mon, 05 May 2025 05:56 AM EDT
Renewable Energy
π° Spain’s blackout highlights renewables’ grid challenge – Yahoo
π
Mon, 05 May 2025 05:57 AM EDT