🔄 卡若AI 同步 2026-03-10 13:34 | 更新:水桥平台对接、卡木、运营中枢工作台 | 排除 >20MB: 11 个

This commit is contained in:
2026-03-10 13:34:37 +08:00
parent c4799d5c45
commit 6f914412d0
16 changed files with 646 additions and 871 deletions

View File

@@ -8,7 +8,7 @@
- 文章已按 **写作/写作规范.md** 写好。
- **第9章第101场及以前**:保存为 `9.xx 第X场主题.md`位于第9章目录。
- **2026 场次第102场及以后**:保存为 `第X场主题.md`,位于 `2026/` 目录。
- **2026 场次第102场及以后**:保存为 `第X场主题.md`,位于 `2026每日派对干货/` 目录。
---
@@ -17,7 +17,7 @@
| 项目 | 值 |
|:---|:---|
| 第9章文章目录 | `/Users/karuo/Documents/个人/2、我写的书/《一场soul的创业实验》/第四篇|真实的赚钱/第9章我在Soul上亲访的赚钱案例/` |
| **2026 场次目录** | `/Users/karuo/Documents/个人/2、我写的书/《一场soul的创业实验》/2026/` |
| **2026 场次目录** | `/Users/karuo/Documents/个人/2、我写的书/《一场soul的创业实验》/2026每日派对干货/` |
| 项目(含 content_upload | `一场soul的创业实验-永平`(根目录有 `content_upload.py` |
| 第9章参数 | part-4, chapter-9, price 1.0 |
| **2026每日派对干货参数** | part-2026-daily, chapter-2026-daily, id 10.xx, price 1.0 |
@@ -39,7 +39,7 @@ python3 content_upload.py --title "第X场标题" \
# 或指定 id如 10.18
python3 content_upload.py --id 10.18 --title "第119场开派对的初心是早上不影响老婆睡觉" \
--content-file "/Users/karuo/Documents/个人/2、我写的书/《一场soul的创业实验》/2026/第119场开派对的初心是早上不影响老婆睡觉.md" \
--content-file "/Users/karuo/Documents/个人/2、我写的书/《一场soul的创业实验》/2026每日派对干货/第119场开派对的初心是早上不影响老婆睡觉.md" \
--part part-2026-daily --chapter chapter-2026-daily --price 1.0
```

View File

@@ -5,4 +5,6 @@
- **链接**https://cunkebao.feishu.cn/wiki/ZdSBwHrsGii14HkcIbccQ0flnee
- **3 月 token**`ZdSBwHrsGii14HkcIbccQ0flnee`(已写入 `.feishu_month_wiki_tokens.json`
**日期以中国时间为准**脚本内「今日」一律按中国时间Asia/Shanghai计算保证写的是 3月10日 即中国 3 月 10 号。
**月份校验**写入前会检查文档标题是否含当月如「3月」。若文档月份与当月不符会提示**请先在飞书新建当月文档,再用 `feishu_token_cli.py set-march-token <新文档token>` 后重试**(先迁一个)。

View File

@@ -13,9 +13,22 @@ import json
import subprocess
import requests
from datetime import datetime, timedelta
from zoneinfo import ZoneInfo
import time
import re
# 飞书日志日期以中国时间为准
CHINA_TZ = ZoneInfo("Asia/Shanghai")
def now_china():
"""当前时间(中国时间)"""
return datetime.now(CHINA_TZ)
def get_today_date_str():
"""今日日期字符串(中国时间),如 3月10日"""
t = now_china()
return f"{t.month}{t.day}"
# ============ 配置 ============
CONFIG = {
'APP_ID': 'cli_a48818290ef8100d',
@@ -152,9 +165,8 @@ def get_token_silent():
# ============ 日志写入 ============
# 写日志前应先读 运营中枢/工作台/2026年整体目标.md使百分比与总目标一致、上下文相关
def get_today_tasks():
"""获取今天的任务(可自定义修改);目标百分比以总目标为核心,见 2026年整体目标.md"""
today = datetime.now()
date_str = f"{today.month}{today.day}"
"""获取今天的任务(可自定义修改);日期以中国时间为准;目标百分比以总目标为核心,见 2026年整体目标.md"""
date_str = get_today_date_str()
# 每日固定项:开发<20%侧重事务与方向每晚20:00玩值电竞朋友圈已入本机日历
tasks = [
@@ -181,11 +193,10 @@ def get_today_tasks():
return date_str, tasks
def build_blocks(date_str, tasks):
"""构建飞书文档块(倒序:新日期在上)"""
"""构建飞书文档块(倒序:新日期在上)callout 易触发 field validation failed改用 text"""
blocks = [
{'block_type': 6, 'heading4': {'elements': [{'text_run': {'content': f'{date_str} '}}], 'style': {'align': 1}}},
{'block_type': 19, 'callout': {'emoji_id': 'sunrise', 'background_color': 2, 'border_color': 2,
'elements': [{'text_run': {'content': '[执行]', 'text_element_style': {'bold': True, 'text_color': 7}}}]}}
{'block_type': 2, 'text': {'elements': [{'text_run': {'content': '[执行]', 'text_element_style': {'bold': True}}}], 'style': {}}}
]
quadrant_colors = {"重要紧急": 5, "重要不紧急": 3, "不重要紧急": 6, "不重要不紧急": 4}
@@ -229,6 +240,23 @@ def build_blocks(date_str, tasks):
return blocks
def _text_block_simple(content):
"""极简文本块,兼容 field validation 严格校验"""
return {'block_type': 2, 'text': {'elements': [{'text_run': {'content': content}}], 'style': {}}}
def _build_blocks_simple(date_str, tasks):
"""极简块(仅纯文本),用于 field validation failed 时回退"""
blocks = [_text_block_simple(f'{date_str} '), _text_block_simple('[执行]')]
for task in tasks:
events = ''.join(task.get('events', []))
blocks.append(_text_block_simple(f"{task.get('person', '')}{events}"))
for key in ('t_targets', 'n_process', 't_thoughts', 'w_work', 'f_feedback'):
for item in task.get(key, []):
blocks.append(_text_block_simple(f" {item}"))
return blocks
def parse_month_from_date_str(date_str):
"""从如 '2月25日' 提取月份整数"""
m = re.search(r'(\d+)\s*月', date_str or '')
@@ -472,11 +500,16 @@ def write_log(token, date_str=None, tasks=None, wiki_token=None, overwrite=False
insert_index = i + 1
break
# 写入(倒序:新日期在上)
# 写入(倒序:新日期在上)field validation failed 时尝试极简纯文本块
content_blocks = build_blocks(date_str, tasks)
payload = {'children': content_blocks, 'index': insert_index}
r = requests.post(f"https://open.feishu.cn/open-apis/docx/v1/documents/{doc_id}/blocks/{doc_id}/children",
headers=headers, json={'children': content_blocks, 'index': insert_index}, timeout=30)
headers=headers, json=payload, timeout=30)
if r.json().get('code') != 0 and 'field validation failed' in (r.json().get('msg') or '').lower():
content_blocks = _build_blocks_simple(date_str, tasks)
payload = {'children': content_blocks, 'index': insert_index}
r = requests.post(f"https://open.feishu.cn/open-apis/docx/v1/documents/{doc_id}/blocks/{doc_id}/children",
headers=headers, json=payload, timeout=30)
if r.json().get('code') == 0:
print(f"{date_str} 日志写入成功 -> {doc_title}")
return True

View File

@@ -3,19 +3,17 @@
今日飞书日志3月定制200视频/日、工具研发1030切片、售内容产出、李永平、年度目标百分比
"""
import sys
from datetime import datetime
from pathlib import Path
SCRIPT_DIR = Path(__file__).resolve().parent
sys.path.insert(0, str(SCRIPT_DIR))
from auto_log import get_token_silent, write_log, open_result, resolve_wiki_token_for_date, CONFIG
from auto_log import get_token_silent, write_log, open_result, resolve_wiki_token_for_date, CONFIG, get_today_date_str
def build_tasks_today():
"""今日200视频/日、工具研发1030切片、售内容产出、按年度目标百分比"""
today = datetime.now()
date_str = f"{today.month}{today.day}"
"""今日200视频/日、工具研发1030切片、售内容产出、按年度目标百分比(日期以中国时间为准)"""
date_str = get_today_date_str()
return [
{
@@ -96,8 +94,7 @@ def build_tasks_today():
def main():
today = datetime.now()
date_str = f"{today.month}{today.day}"
date_str = get_today_date_str()
print("=" * 50)
print(f"📝 写入今日飞书日志200视频+工具研发+售内容+年度目标%{date_str}")
print("=" * 50)

View File

@@ -13,13 +13,12 @@ from pathlib import Path
SCRIPT_DIR = Path(__file__).resolve().parent
sys.path.insert(0, str(SCRIPT_DIR))
from auto_log import get_token_silent, write_log, open_result, resolve_wiki_token_for_date, CONFIG
from auto_log import get_token_silent, write_log, open_result, resolve_wiki_token_for_date, CONFIG, get_today_date_str
def build_tasks_today_three_focus():
"""今日三件事 + 前面未完成;百分比以 2026年整体目标.md 为基准"""
today = datetime.now()
date_str = f"{today.month}{today.day}"
"""今日三件事 + 前面未完成;日期以中国时间为准;百分比以 2026年整体目标.md 为基准"""
date_str = get_today_date_str()
# 前面未完成(延续 3 月 / 本月未闭环)
unfinished = [
"20 条 Soul 视频 + 20:00 发 1 条朋友圈(每日固定)",
@@ -79,10 +78,9 @@ def main():
parser.add_argument("--overwrite", action="store_true", help="覆盖已有当日日志")
args = parser.parse_args()
today = datetime.now()
date_str = f"{today.month}{today.day}"
date_str = get_today_date_str()
print("=" * 50)
print(f"📝 写入今日飞书日志:{date_str}" + (" [覆盖]" if args.overwrite else ""))
print(f"📝 写入今日飞书日志(中国时间){date_str}" + (" [覆盖]" if args.overwrite else ""))
print(" ① 卡若AI 完善/接口可用 ② 一场创业实验 网站/小程序上线 ③ 玩值电竞 布局 + 前面未完成")
print("=" * 50)

View File

@@ -11,7 +11,7 @@ from pathlib import Path
SCRIPT_DIR = Path(__file__).resolve().parent
sys.path.insert(0, str(SCRIPT_DIR))
from auto_log import get_token_silent, write_log, open_result, resolve_wiki_token_for_date, CONFIG
from auto_log import get_token_silent, write_log, open_result, resolve_wiki_token_for_date, CONFIG, get_today_date_str
REF_DIR = SCRIPT_DIR.parent / "参考资料"
@@ -85,9 +85,8 @@ def _upload_and_insert_image(token: str, doc_id: str, image_path: Path, date_str
def build_tasks_today_with_summary():
"""今日:最近进度汇总 + 每天20切片 + 1980成交及全链路 + 目标百分比"""
today = datetime.now()
date_str = f"{today.month}{today.day}"
"""今日:最近进度汇总 + 每天20切片 + 1980成交及全链路 + 目标百分比(日期以中国时间为准)"""
date_str = get_today_date_str()
# 最近进度汇总(来自全库+智能纪要 output
summary = [
"【进度汇总】飞书 Token 全命令行get/set-march-token、今日日志三件事+未完成已固化",
@@ -126,8 +125,7 @@ def build_tasks_today_with_summary():
def main():
today = datetime.now()
date_str = f"{today.month}{today.day}"
date_str = get_today_date_str()
print("=" * 50)
print(f"📝 写入今日飞书日志(进度汇总+20切片+1980全链路+百分比):{date_str}")
print("=" * 50)