← back to Stars of Design
Mac2 sync-and-push job for the /videos All News Daily section (keeps it auto-updated on prod)
88cd92f2805ec0f32cdc97fd8ae742cc85bc9696 · 2026-09-09 23:46:39 -0700 · Steve Abrams
Files touched
A com.steve.starsofdesign-videos-push.plistA scripts/push-allnewsdaily-videos.sh
Diff
commit 88cd92f2805ec0f32cdc97fd8ae742cc85bc9696
Author: Steve Abrams <steve@designerwallcoverings.com>
Date: Wed Sep 9 23:46:39 2026 -0700
Mac2 sync-and-push job for the /videos All News Daily section (keeps it auto-updated on prod)
---
com.steve.starsofdesign-videos-push.plist | 43 +++++++++++++++++++++++++++++++
scripts/push-allnewsdaily-videos.sh | 27 +++++++++++++++++++
2 files changed, 70 insertions(+)
diff --git a/com.steve.starsofdesign-videos-push.plist b/com.steve.starsofdesign-videos-push.plist
new file mode 100644
index 0000000..cf911d6
--- /dev/null
+++ b/com.steve.starsofdesign-videos-push.plist
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<!-- Mac2 job: sync the All News Daily channel + push allnewsdaily-videos.json to Kamatera so
+ starsofdesign.com/videos auto-updates. Runs ~30min after each Short publishes, + on load.
+ NOT loaded automatically — it does a remote push to prod, which is Steve-gated.
+ Load: launchctl bootstrap gui/$(id -u) ~/Library/LaunchAgents/com.steve.starsofdesign-videos-push.plist
+ Unload: launchctl bootout gui/$(id -u) ~/Library/LaunchAgents/com.steve.starsofdesign-videos-push.plist -->
+<plist version="1.0">
+<dict>
+ <key>Label</key>
+ <string>com.steve.starsofdesign-videos-push</string>
+
+ <key>ProgramArguments</key>
+ <array>
+ <string>/bin/bash</string>
+ <string>/Users/macstudio3/Projects/starsofdesign/scripts/push-allnewsdaily-videos.sh</string>
+ </array>
+
+ <key>EnvironmentVariables</key>
+ <dict>
+ <key>PATH</key>
+ <string>/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin</string>
+ <key>HOME</key>
+ <string>/Users/macstudio3</string>
+ </dict>
+
+ <key>RunAtLoad</key>
+ <true/>
+
+ <key>StartCalendarInterval</key>
+ <array>
+ <dict><key>Hour</key><integer>6</integer><key>Minute</key><integer>30</integer></dict>
+ <dict><key>Hour</key><integer>11</integer><key>Minute</key><integer>30</integer></dict>
+ <dict><key>Hour</key><integer>16</integer><key>Minute</key><integer>30</integer></dict>
+ <dict><key>Hour</key><integer>21</integer><key>Minute</key><integer>30</integer></dict>
+ </array>
+
+ <key>StandardOutPath</key>
+ <string>/Users/macstudio3/Projects/starsofdesign/data/videos-push.log</string>
+ <key>StandardErrorPath</key>
+ <string>/Users/macstudio3/Projects/starsofdesign/data/videos-push.log</string>
+</dict>
+</plist>
diff --git a/scripts/push-allnewsdaily-videos.sh b/scripts/push-allnewsdaily-videos.sh
new file mode 100755
index 0000000..843ef94
--- /dev/null
+++ b/scripts/push-allnewsdaily-videos.sh
@@ -0,0 +1,27 @@
+#!/usr/bin/env bash
+# Sync the All News Daily channel's Shorts on THIS Mac (where the YouTube token lives) then rsync the
+# resulting data/allnewsdaily-videos.json to Kamatera prod, so starsofdesign.com/videos stays auto-updated.
+# Modeled on the allnewsdaily wire-push/live-push pattern. Reversible: unload the launchd job to stop.
+set -euo pipefail
+cd "$(dirname "$0")/.." # starsofdesign repo root
+PROD="${PROD_HOST:-root@45.61.58.125}"
+REMOTE="/root/Projects/starsofdesign/data/allnewsdaily-videos.json"
+
+# Resolve node robustly (launchd has a minimal PATH).
+NODE="$(command -v node || true)"
+for cand in /opt/homebrew/bin/node /usr/local/bin/node /usr/bin/node; do
+ [ -z "$NODE" ] && [ -x "$cand" ] && NODE="$cand"
+done
+[ -n "$NODE" ] || { echo "[sod-videos-push] node not found"; exit 3; }
+
+# 1) refresh the video list from the channel (best-effort; keeps prior file on failure)
+"$NODE" scripts/sync-allnewsdaily-videos.mjs || { echo "[sod-videos-push] sync failed, not pushing"; exit 1; }
+
+# 2) only push a valid JSON array
+"$NODE" -e "const a=require('./data/allnewsdaily-videos.json'); if(!Array.isArray(a)){process.exit(2)}" \
+ || { echo "[sod-videos-push] allnewsdaily-videos.json invalid, not pushing"; exit 2; }
+
+# 3) rsync just the data file to prod (the running app reads it on the next request; mtime-cached)
+rsync -az -e "ssh -o ConnectTimeout=10 -o StrictHostKeyChecking=accept-new" \
+ data/allnewsdaily-videos.json "$PROD:$REMOTE"
+echo "[sod-videos-push] pushed $(date -u +%FT%TZ) → $PROD:$REMOTE"
← 8ffbfd9 Add auto-updating All News Daily embedded Shorts section to
·
back to Stars of Design
·
promote-candidates: enumerate columns instead of SELECT * (s 1072d8b →