init: inspiration collector v1.0

This commit is contained in:
2026-06-12 23:30:27 +08:00
commit 5a876e5ecd
17 changed files with 881 additions and 0 deletions

28
scripts/run_weekly_trend.sh Executable file
View File

@ -0,0 +1,28 @@
#!/bin/bash
# Weekly trend cron wrapper
# Run every Sunday at 08:00 UTC (16:00 Beijing)
set -e
PROJECT_DIR="$HOME/inspiration-collector"
LOG_FILE="$PROJECT_DIR/ai-insights/logs/weekly_trend.log"
mkdir -p "$(dirname "$LOG_FILE")"
echo "[$(date '+%Y-%m-%d %H:%M:%S')] Starting weekly trend..." >> "$LOG_FILE"
cd "$PROJECT_DIR"
python3 analyzers/weekly_trend.py >> "$LOG_FILE" 2>&1
# Git push to Gitea
cd "$PROJECT_DIR"
if [[ -n $(git status --porcelain ai-insights/) ]]; then
git add ai-insights/
git commit -m "weekly trend W$(date '+%V')"
git push origin main 2>&1 | tail -3 >> "$LOG_FILE"
echo "Pushed to Gitea" >> "$LOG_FILE"
else
echo "No changes to push" >> "$LOG_FILE"
fi
echo "[$(date '+%Y-%m-%d %H:%M:%S')] Weekly trend done." >> "$LOG_FILE"