https://github.com/piotr-ku/war-alert
RSS feeds monitoring for specific news alerts, processes them with OpenAI's API, and sends notifications via Pushover.
https://github.com/piotr-ku/war-alert
alert alerting news notifications openai pushover rss war
Last synced: 8 months ago
JSON representation
RSS feeds monitoring for specific news alerts, processes them with OpenAI's API, and sends notifications via Pushover.
- Host: GitHub
- URL: https://github.com/piotr-ku/war-alert
- Owner: piotr-ku
- License: mit
- Created: 2024-12-03T17:45:41.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-06-10T10:46:21.000Z (about 1 year ago)
- Last Synced: 2025-06-10T11:39:21.127Z (about 1 year ago)
- Topics: alert, alerting, news, notifications, openai, pushover, rss, war
- Language: Python
- Homepage:
- Size: 23.4 KB
- Stars: 3
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# War Alert Script
This script monitors RSS feeds for specific news alerts, processes them with OpenAI's API, and sends notifications via Pushover or Telegram. It ensures that duplicate news items are ignored and provides detailed logging for each step of the process.
## Features
- Fetches and parses RSS feeds.
- Detects duplicate news items using MD5 hashes.
- Processes news items using OpenAI's API with custom prompts.
- Sends notifications via Pushover for relevant alerts.
- Handles graceful shutdown via signal handling.
- Configurable via environment variables.
## Requirements
- Python 3.6+
- Required Python libraries:
- `dotenv`
- `requests`
- `openai`
- External APIs:
- OpenAI API
- Pushover API
## Installation
1. Clone this repository:
```bash
git clone
cd
```
2. Create a `.env` file in the project root with the following variables:
```env
EMAIL_FROM=
EMAIL_TO=
RSS_URLS=
PUSHOVER_TOKEN=
PUSHOVER_USER=
OPENAI_API_KEY=
PROMPT_FILE=
SLEEP_DELAY=600
SMTP_SERVER=
SMTP_PORT=
SMTP_LOGIN=
SMTP_PASSWORD=
TELEGRAM_BOT_TOKEN=
TELEGRAM_CHANNEL_ID=
TMPDIR=/tmp
```
Adjust `SLEEP_DELAY` (in seconds) and `TMPDIR` as needed.
3. Modify the `prompt.txt` file with your OpenAI query template.
## Usage
Run the script using:
```bash
./war-alert.sh
```
### Logging
The script logs to `stdout` with detailed information about each step, including any errors encountered during API calls or processing.
### Notifications
Relevant alerts are sent as Pushover notifications with the title "War Alert" and the justification from the OpenAI response.
## Notes
- Ensure the OpenAI and Pushover credentials are valid.
- Adjust RSS feed URLs and prompt content to match your requirements.
- Temporary files for tracking processed items are stored in the directory specified by the `TMPDIR` environment variable.
## License
This project is licensed under the MIT License. See the `LICENSE` file for details.
## Contributing
Feel free to open issues or submit pull requests to improve this script.