An automated tool that fetches articles from RSS feeds, summarizes them using OpenAI's GPT models, and emails the summaries daily.
- Fetches articles from multiple RSS feeds
- Summarizes articles using OpenAI's GPT models
- Sends daily email digests with article summaries
- Caches processed articles to avoid duplicates
- Configurable time window for article processing
- Customizable summary prompts
- Daily digest of summarized articles
- Articles grouped by category
- Support for multiple recipients via BCC
- HTML formatted emails with clickable links
- Source and publication date included for each article
The application includes an article caching system that:
- Prevents duplicate processing of articles
- Archives old entries after 30 days
- Stores cache in JSON format
- Maintains separate active and archive caches
- Python 3.8+
- Gmail account
- OpenAI API key
- Google App Password for Gmail
-
Clone the repository:
git clone https://github.com/ayyzad/rss-summarizer.git
-
Install dependencies:
pip install -r requirements.txt
-
Create a Google App Password:
- Go to your Google Account settings
- Navigate to Security
- Enable 2-Step Verification if not already enabled
- Under "Signing in to Google," select "App passwords"
- Generate a new app password for "Mail"
- Copy the 16-character password
-
Create environment variables:
- Copy
.env.example
to.env
- Fill in your OpenAI API key
- Add your Gmail address
- Add the Google App Password (not your regular Gmail password)
- Add recipient email addresses (comma-separated for BCC)
- Copy
-
Configure RSS feeds:
- Edit
config.json
to add your desired RSS feed URLs - Adjust settings in
config.py
if needed
- Edit
Run ad-hoc:
python main.py
Run scheduled (daily at 8:00 AM):
python main.py --schedule
RSS-Summarizer/
├── articles/ # Stores JSON files of summarized articles
├── logs/ # Log files directory
├── config.json # RSS feed URLs configuration
├── config.py # General configuration settings
├── email_sender.py # Email functionality
├── feed_parser.py # RSS feed parsing
├── main.py # Main application entry point
├── summarizer.py # OpenAI integration for summarization
└── article_cache.py # Cache system for processed articles
Edit config.json
to add or remove RSS feeds:
{
"feed_urls": [
"https://example.com/feed1.xml",
"https://example.com/feed2.xml"
]
}
Adjust settings in config.py
:
MAX_ARTICLES
: Maximum articles to process per feedTIME_WINDOW
: Time window for article processing (in seconds)SYSTEM_PROMPT
: Customize the summarization prompt- Email settings (SMTP configuration)
Logs are stored in logs/
. The log level can be adjusted in the code to show more or less detail.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature
) - Commit your changes (
git commit -m 'Add some AmazingFeature'
) - Push to the branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.