feat: 阅读周报 + 工作日志(日报/周报) 报告生成脚本

This commit is contained in:
fxy
2026-06-19 10:34:30 +08:00
parent 90aa8e99b6
commit 51466aaa1e
6 changed files with 793 additions and 0 deletions

View File

@ -0,0 +1,29 @@
#!/bin/bash
# Daily work report generator
# Reads today's work-related Memos → generates daily work log
# Run: daily, alongside the daily digest (22:00 Beijing = 14:00 UTC)
set -e
INSP_DIR="/home/ubuntu/inspiration-collector"
LOG_FILE="/tmp/daily_work_report_$(date +%Y%m%d).log"
echo "[$(date)] Starting daily work report..." | tee "$LOG_FILE"
cd "$INSP_DIR"
git pull origin main 2>&1 | tee -a "$LOG_FILE"
echo "[$(date)] Running analyzer..." | tee -a "$LOG_FILE"
python3 analyzers/daily_work_report.py 2>&1 | tee -a "$LOG_FILE"
echo "[$(date)] Committing and pushing..." | tee -a "$LOG_FILE"
git add ai-insights/daily/ 2>/dev/null || true
if git diff --cached --quiet; then
echo "[$(date)] No changes" | tee -a "$LOG_FILE"
else
git commit -m "daily: work report $(date +%Y-%m-%d)" 2>&1 | tee -a "$LOG_FILE"
git push origin main 2>&1 | tee -a "$LOG_FILE"
fi
echo "[$(date)] Done." | tee -a "$LOG_FILE"

View File

@ -0,0 +1,43 @@
#!/bin/bash
# Weekly reading report generator
# Reads 7 daily reading reports → DeepSeek API → weekly analysis
# Run: weekly, Sunday 16:30 Beijing time (08:30 UTC)
#
# NOTE: Script lives in inspiration-collector/scripts/ but output
# goes to weread-notes/weekly/. Both repos are siblings on the server.
set -e
INSP_DIR="/home/ubuntu/inspiration-collector"
WEREAD_DIR="/home/ubuntu/weread-notes"
LOG_FILE="/tmp/weekly_reading_report_$(date +%Y%m%d_%H%M).log"
echo "[$(date)] Starting weekly reading report..." | tee "$LOG_FILE"
# Pull latest in both repos
echo "[$(date)] Pulling weread-notes..." | tee -a "$LOG_FILE"
cd "$WEREAD_DIR"
git pull origin main 2>&1 | tee -a "$LOG_FILE"
echo "[$(date)] Pulling inspiration-collector..." | tee -a "$LOG_FILE"
cd "$INSP_DIR"
git pull origin main 2>&1 | tee -a "$LOG_FILE"
# Run the analyzer (it reads from weread-notes/daily/ and writes to weread-notes/weekly/)
echo "[$(date)] Running analyzer..." | tee -a "$LOG_FILE"
cd "$INSP_DIR"
python3 analyzers/weekly_reading_report.py 2>&1 | tee -a "$LOG_FILE"
# Commit and push weread-notes
echo "[$(date)] Committing weread-notes..." | tee -a "$LOG_FILE"
cd "$WEREAD_DIR"
git add weekly/ 2>/dev/null || true
if git diff --cached --quiet; then
echo "[$(date)] No changes to commit in weread-notes" | tee -a "$LOG_FILE"
else
git commit -m "weekly: reading report $(date +%Y-%m-%d)" 2>&1 | tee -a "$LOG_FILE"
git push origin main 2>&1 | tee -a "$LOG_FILE"
fi
echo "[$(date)] Done." | tee -a "$LOG_FILE"

View File

@ -0,0 +1,29 @@
#!/bin/bash
# Weekly work report generator
# Reads 7 daily work logs → DeepSeek API → weekly work analysis
# Run: weekly, Sunday 17:00 Beijing time (09:00 UTC)
set -e
INSP_DIR="/home/ubuntu/inspiration-collector"
LOG_FILE="/tmp/weekly_work_report_$(date +%Y%m%d_%H%M).log"
echo "[$(date)] Starting weekly work report..." | tee "$LOG_FILE"
cd "$INSP_DIR"
git pull origin main 2>&1 | tee -a "$LOG_FILE"
echo "[$(date)] Running analyzer..." | tee -a "$LOG_FILE"
python3 analyzers/weekly_work_report.py 2>&1 | tee -a "$LOG_FILE"
echo "[$(date)] Committing and pushing..." | tee -a "$LOG_FILE"
git add ai-insights/weekly/ 2>/dev/null || true
if git diff --cached --quiet; then
echo "[$(date)] No changes" | tee -a "$LOG_FILE"
else
git commit -m "weekly: work report $(date +%Y-%m-%d)" 2>&1 | tee -a "$LOG_FILE"
git push origin main 2>&1 | tee -a "$LOG_FILE"
fi
echo "[$(date)] Done." | tee -a "$LOG_FILE"