{"id":28924193,"url":"https://github.com/piotr-ku/war-alert","last_synced_at":"2025-10-26T17:38:01.750Z","repository":{"id":266338615,"uuid":"898052237","full_name":"piotr-ku/war-alert","owner":"piotr-ku","description":"RSS feeds monitoring for specific news alerts, processes them with OpenAI's API, and sends notifications via Pushover.","archived":false,"fork":false,"pushed_at":"2025-06-10T10:46:21.000Z","size":24,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-10T11:39:21.127Z","etag":null,"topics":["alert","alerting","news","notifications","openai","pushover","rss","war"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/piotr-ku.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-12-03T17:45:41.000Z","updated_at":"2025-06-10T10:46:18.000Z","dependencies_parsed_at":null,"dependency_job_id":"e8d8c27c-b0dc-40ac-9fdb-a02ae3102f02","html_url":"https://github.com/piotr-ku/war-alert","commit_stats":null,"previous_names":["piotr-ku/war-alert"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/piotr-ku/war-alert","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/piotr-ku%2Fwar-alert","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/piotr-ku%2Fwar-alert/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/piotr-ku%2Fwar-alert/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/piotr-ku%2Fwar-alert/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/piotr-ku","download_url":"https://codeload.github.com/piotr-ku/war-alert/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/piotr-ku%2Fwar-alert/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261273877,"owners_count":23133836,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["alert","alerting","news","notifications","openai","pushover","rss","war"],"created_at":"2025-06-22T10:10:03.179Z","updated_at":"2025-10-26T17:38:01.745Z","avatar_url":"https://github.com/piotr-ku.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# War Alert Script\n\nThis 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.\n\n## Features\n\n- Fetches and parses RSS feeds.\n- Detects duplicate news items using MD5 hashes.\n- Processes news items using OpenAI's API with custom prompts.\n- Sends notifications via Pushover for relevant alerts.\n- Handles graceful shutdown via signal handling.\n- Configurable via environment variables.\n\n## Requirements\n\n- Python 3.6+\n- Required Python libraries:\n  - `dotenv`\n  - `requests`\n  - `openai`\n- External APIs:\n  - OpenAI API\n  - Pushover API\n\n## Installation\n\n1. Clone this repository:\n   ```bash\n   git clone \u003crepository-url\u003e\n   cd \u003crepository-name\u003e\n   ```\n\n2. Create a `.env` file in the project root with the following variables:\n   ```env\n   EMAIL_FROM=\u003cyour-email-address\u003e\n   EMAIL_TO=\u003cspace-separated-list-of-email-addresses\u003e\n   RSS_URLS=\u003cspace-separated-list-of-rss-urls\u003e\n   PUSHOVER_TOKEN=\u003cyour-pushover-api-token\u003e\n   PUSHOVER_USER=\u003cyour-pushover-user-key\u003e\n   OPENAI_API_KEY=\u003cyour-openai-api-key\u003e\n   PROMPT_FILE=\u003cpath-to-prompt-file\u003e\n   SLEEP_DELAY=600\n   SMTP_SERVER=\u003cyour-smtp-server\u003e\n   SMTP_PORT=\u003cyour-smtp-port\u003e\n   SMTP_LOGIN=\u003cyour-smtp-username\u003e\n   SMTP_PASSWORD=\u003cyour-smtp-password\u003e\n   TELEGRAM_BOT_TOKEN=\u003cyour-telegram-bot-token\u003e\n   TELEGRAM_CHANNEL_ID=\u003cyour-telegram-channel-id\u003e\n   TMPDIR=/tmp\n   ```\n   Adjust `SLEEP_DELAY` (in seconds) and `TMPDIR` as needed.\n\n3. Modify the `prompt.txt` file with your OpenAI query template.\n\n## Usage\n\nRun the script using:\n```bash\n./war-alert.sh\n```\n\n### Logging\nThe script logs to `stdout` with detailed information about each step, including any errors encountered during API calls or processing.\n\n### Notifications\nRelevant alerts are sent as Pushover notifications with the title \"War Alert\" and the justification from the OpenAI response.\n\n## Notes\n\n- Ensure the OpenAI and Pushover credentials are valid.\n- Adjust RSS feed URLs and prompt content to match your requirements.\n- Temporary files for tracking processed items are stored in the directory specified by the `TMPDIR` environment variable.\n\n## License\n\nThis project is licensed under the MIT License. See the `LICENSE` file for details.\n\n## Contributing\n\nFeel free to open issues or submit pull requests to improve this script.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpiotr-ku%2Fwar-alert","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpiotr-ku%2Fwar-alert","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpiotr-ku%2Fwar-alert/lists"}