Download src/utils/webhook_alert.py from TTOPM/belel-protocol: direct link, hf CLI and curl.
- Browser
- Download file 442 Bytes
-
https://huggingface.co/TTOPM/belel-protocol/resolve/main/src/utils/webhook_alert.py
- Command line
-
hf download hf://TTOPM/belel-protocol/src/utils/webhook_alert.py
-
curl -L -o webhook_alert.py https://huggingface.co/TTOPM/belel-protocol/resolve/main/src/utils/webhook_alert.py
442 Bytes
| import requests | |
| import logging | |
| logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s') | |
| def send_webhook_alert(webhook_url: str, payload: dict): | |
| try: | |
| response = requests.post(webhook_url, json=payload) | |
| response.raise_for_status() | |
| logging.info(f"Webhook alert sent. Status: {response.status_code}") | |
| except Exception as e: | |
| logging.error(f"Webhook alert failed: {e}") | |