AI Newsletter Digest improvements: fixed QP soft line break decoding, URL extraction, and content cleaning

This commit is contained in:
Krilly
2026-03-04 13:29:22 +00:00
parent 29a98137a7
commit 57dd294675
13706 changed files with 2114953 additions and 237629 deletions

View File

@@ -0,0 +1,44 @@
#!/bin/bash
# Polls the OpenClaw gateway health endpoint.
# Sends a Telegram notification whenever it recovers after being unreachable.
BOT_TOKEN="8598508497:AAHmTMbnR7un2ADtmsjJr8moQkDOU9ILBps"
CHAT_ID="1793951355"
GATEWAY_URL="http://127.0.0.1:18789"
POLL_INTERVAL=3 # seconds between checks
LOG_PREFIX="[$(date '+%Y-%m-%d %H:%M:%S')]"
send_notification() {
curl -s -X POST "https://api.telegram.org/bot${BOT_TOKEN}/sendMessage" \
-H "Content-Type: application/json" \
-d "{
\"chat_id\": \"${CHAT_ID}\",
\"text\": \"✅ *Krilly is back online!*\n\nOpenClaw gateway restarted and is ready to go 🦀\",
\"parse_mode\": \"Markdown\"
}" > /dev/null
}
is_up() {
STATUS=$(curl -s -o /dev/null -w "%{http_code}" --max-time 3 "${GATEWAY_URL}/health" 2>/dev/null)
[ "$STATUS" = "200" ] || [ "$STATUS" = "401" ]
}
echo "$(date '+%Y-%m-%d %H:%M:%S') Gateway watcher started"
WAS_UP=true
while true; do
if is_up; then
if [ "$WAS_UP" = "false" ]; then
echo "$(date '+%Y-%m-%d %H:%M:%S') Gateway recovered — sending notification"
send_notification
fi
WAS_UP=true
else
if [ "$WAS_UP" = "true" ]; then
echo "$(date '+%Y-%m-%d %H:%M:%S') Gateway went down"
fi
WAS_UP=false
fi
sleep "$POLL_INTERVAL"
done