diff --git a/automations/birthday-tracker/birthday-tracker.sh b/automations/birthday-tracker/birthday-tracker.sh index e6932c8..f78ba0e 100755 --- a/automations/birthday-tracker/birthday-tracker.sh +++ b/automations/birthday-tracker/birthday-tracker.sh @@ -11,6 +11,8 @@ LOG_FILE="$SCRIPT_DIR/reminder-log.json" source "$SCRIPT_DIR/../../.env" 2>/dev/null || true TELEGRAM_CHAT="${TELEGRAM_CHAT:-1793951355}" +GOTIFY_URL="${GOTIFY_URL:-http://runtipi.kangaroo-eel.ts.net:8129}" +GOTIFY_TOKEN="${GOTIFY_TOKEN:-AGKnHafW3FGzBlt}" log() { 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 gift_suggestions() { local ideas=$(echo "$1" | jq -r '.gift_ideas | join(", ")') @@ -248,6 +268,14 @@ check_birthdays() { if [[ "$should_remind" == true ]]; then log "Sending $reminder_type reminder for $name" 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" ((reminders_sent++)) fi diff --git a/automations/birthday-tracker/birthdays.json b/automations/birthday-tracker/birthdays.json index 619a72a..7ced8da 100644 --- a/automations/birthday-tracker/birthdays.json +++ b/automations/birthday-tracker/birthdays.json @@ -35,14 +35,6 @@ "notes": "8 years old (born July 2016). Loves games, books, LEGO, sports.", "gift_ideas": ["LEGO set", "Books", "Board games", "Sports equipment", "Science kit"], "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": { diff --git a/automations/freshrss-digest/daily-digest.sh b/automations/freshrss-digest/daily-digest.sh index 69576af..05c0a37 100755 --- a/automations/freshrss-digest/daily-digest.sh +++ b/automations/freshrss-digest/daily-digest.sh @@ -12,6 +12,8 @@ source "$SCRIPT_DIR/../../.env" 2>/dev/null || true FRESHRSS_URL="${FRESHRSS_URL:-http://freshrss.kangaroo-eel.ts.net}" FRESHRSS_USER="${FRESHRSS_USER:-anthony}" 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 INTERESTS=( @@ -187,6 +189,27 @@ send_telegram() { 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() { log "Starting FreshRSS digest..." @@ -198,9 +221,14 @@ main() { local digest digest=$(build_digest "$raw_articles") - # Send + # Send to both channels 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!" }