Update automations: 3x daily FreshRSS, remove Mia, add Gotify, remove server monitor
- FreshRSS now runs 3x daily: 6:45 AM, 12 PM, 5 PM
- Removed Mia from birthday tracker 💔
- Removed home stack monitor cron jobs (already have monitoring)
- Added Gotify notifications to FreshRSS and birthday tracker
- Both Telegram and Gotify now receive alerts
This commit is contained in:
@@ -11,6 +11,8 @@ LOG_FILE="$SCRIPT_DIR/reminder-log.json"
|
|||||||
source "$SCRIPT_DIR/../../.env" 2>/dev/null || true
|
source "$SCRIPT_DIR/../../.env" 2>/dev/null || true
|
||||||
|
|
||||||
TELEGRAM_CHAT="${TELEGRAM_CHAT:-1793951355}"
|
TELEGRAM_CHAT="${TELEGRAM_CHAT:-1793951355}"
|
||||||
|
GOTIFY_URL="${GOTIFY_URL:-http://runtipi.kangaroo-eel.ts.net:8129}"
|
||||||
|
GOTIFY_TOKEN="${GOTIFY_TOKEN:-AGKnHafW3FGzBlt}"
|
||||||
|
|
||||||
log() {
|
log() {
|
||||||
echo "[$(date '+%Y-%m-%d %H:%M:%S')] $1"
|
echo "[$(date '+%Y-%m-%d %H:%M:%S')] $1"
|
||||||
@@ -165,6 +167,24 @@ send_telegram() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Send Gotify message
|
||||||
|
send_gotify() {
|
||||||
|
local title="$1"
|
||||||
|
local message="$2"
|
||||||
|
local priority="${3:-5}"
|
||||||
|
|
||||||
|
curl -s -X POST "${GOTIFY_URL}/message?token=${GOTIFY_TOKEN}" \
|
||||||
|
-H "Content-Type: application/json" \
|
||||||
|
-d "{
|
||||||
|
\"title\": \"$title\",
|
||||||
|
\"message\": \"$message\",
|
||||||
|
\"priority\": $priority
|
||||||
|
}" > /dev/null || {
|
||||||
|
log "ERROR: Failed to send Gotify message"
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
# Generate gift suggestions text
|
# Generate gift suggestions text
|
||||||
gift_suggestions() {
|
gift_suggestions() {
|
||||||
local ideas=$(echo "$1" | jq -r '.gift_ideas | join(", ")')
|
local ideas=$(echo "$1" | jq -r '.gift_ideas | join(", ")')
|
||||||
@@ -248,6 +268,14 @@ check_birthdays() {
|
|||||||
if [[ "$should_remind" == true ]]; then
|
if [[ "$should_remind" == true ]]; then
|
||||||
log "Sending $reminder_type reminder for $name"
|
log "Sending $reminder_type reminder for $name"
|
||||||
send_telegram "$message"
|
send_telegram "$message"
|
||||||
|
|
||||||
|
# Also send to Gotify (strip markdown for cleaner display)
|
||||||
|
local plain_message
|
||||||
|
plain_message=$(echo -e "$message" | sed 's/\*//g')
|
||||||
|
local priority=5
|
||||||
|
[[ "$reminder_type" == "today" ]] && priority=8
|
||||||
|
send_gotify "Birthday: $name" "$plain_message" "$priority"
|
||||||
|
|
||||||
log_reminder "$name" "$reminder_type"
|
log_reminder "$name" "$reminder_type"
|
||||||
((reminders_sent++))
|
((reminders_sent++))
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -35,14 +35,6 @@
|
|||||||
"notes": "8 years old (born July 2016). Loves games, books, LEGO, sports.",
|
"notes": "8 years old (born July 2016). Loves games, books, LEGO, sports.",
|
||||||
"gift_ideas": ["LEGO set", "Books", "Board games", "Sports equipment", "Science kit"],
|
"gift_ideas": ["LEGO set", "Books", "Board games", "Sports equipment", "Science kit"],
|
||||||
"past_gifts": []
|
"past_gifts": []
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Mia Martin",
|
|
||||||
"relationship": "Doggo 🐕",
|
|
||||||
"birthday": "XX-XX",
|
|
||||||
"notes": "14 years old, beloved geriatric girl. Treats, toys, comfy beds.",
|
|
||||||
"gift_ideas": ["Premium dog treats", "Comfy bed", "New toy", "Grooming session"],
|
|
||||||
"past_gifts": []
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"settings": {
|
"settings": {
|
||||||
|
|||||||
@@ -12,6 +12,8 @@ source "$SCRIPT_DIR/../../.env" 2>/dev/null || true
|
|||||||
FRESHRSS_URL="${FRESHRSS_URL:-http://freshrss.kangaroo-eel.ts.net}"
|
FRESHRSS_URL="${FRESHRSS_URL:-http://freshrss.kangaroo-eel.ts.net}"
|
||||||
FRESHRSS_USER="${FRESHRSS_USER:-anthony}"
|
FRESHRSS_USER="${FRESHRSS_USER:-anthony}"
|
||||||
TELEGRAM_CHAT="${TELEGRAM_CHAT:-1793951355}"
|
TELEGRAM_CHAT="${TELEGRAM_CHAT:-1793951355}"
|
||||||
|
GOTIFY_URL="${GOTIFY_URL:-http://runtipi.kangaroo-eel.ts.net:8129}"
|
||||||
|
GOTIFY_TOKEN="${GOTIFY_TOKEN:-AGKnHafW3FGzBlt}"
|
||||||
|
|
||||||
# Your interest keywords for relevance ranking
|
# Your interest keywords for relevance ranking
|
||||||
INTERESTS=(
|
INTERESTS=(
|
||||||
@@ -187,6 +189,27 @@ send_telegram() {
|
|||||||
log "Sent to Telegram successfully"
|
log "Sent to Telegram successfully"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
send_gotify() {
|
||||||
|
local title="$1"
|
||||||
|
local message="$2"
|
||||||
|
local priority="${3:-5}"
|
||||||
|
|
||||||
|
log "Sending to Gotify..."
|
||||||
|
|
||||||
|
curl -s -X POST "${GOTIFY_URL}/message?token=${GOTIFY_TOKEN}" \
|
||||||
|
-H "Content-Type: application/json" \
|
||||||
|
-d "{
|
||||||
|
\"title\": \"$title\",
|
||||||
|
\"message\": \"$message\",
|
||||||
|
\"priority\": $priority
|
||||||
|
}" > /dev/null || {
|
||||||
|
log "ERROR: Failed to send Gotify message"
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
|
||||||
|
log "Sent to Gotify successfully"
|
||||||
|
}
|
||||||
|
|
||||||
main() {
|
main() {
|
||||||
log "Starting FreshRSS digest..."
|
log "Starting FreshRSS digest..."
|
||||||
|
|
||||||
@@ -198,9 +221,14 @@ main() {
|
|||||||
local digest
|
local digest
|
||||||
digest=$(build_digest "$raw_articles")
|
digest=$(build_digest "$raw_articles")
|
||||||
|
|
||||||
# Send
|
# Send to both channels
|
||||||
send_telegram "$digest"
|
send_telegram "$digest"
|
||||||
|
|
||||||
|
# Plain text version for Gotify (strip markdown)
|
||||||
|
local plain_digest
|
||||||
|
plain_digest=$(echo -e "$digest" | sed 's/\*//g' | sed 's/\[\([^]]*\)\]([^)]*)/\1/g')
|
||||||
|
send_gotify "FreshRSS Digest" "$plain_digest" 5
|
||||||
|
|
||||||
log "Digest complete!"
|
log "Digest complete!"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user