Files
dc-docs/scripts/garden_related.py
T
Evilom fe5505343e feat: 钉钉群聊飞书文档收集与知识图谱系统初始提交
- 通过悟空(dws CLI)拉取dc战略问题研究院+创新组两个群的消息(377条)
- 提取190个飞书链接、18个文件附件
- 下载HTML/MD/XLSX等报告文件到output/downloaded-files/
- 构建知识图谱(JSON+HTML可视化)
- 生成Obsidian知识库(28个页面,7大主题)
- 生成花园世界全量汇总报告
- 所有脚本路径改为相对路径,便于迁移
2026-06-02 20:24:25 +08:00

35 lines
1.5 KiB
Python

import sys, io, json, re
sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding="utf-8")
import os
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
PROJECT_ROOT = os.path.dirname(SCRIPT_DIR)
with open(os.path.join(PROJECT_ROOT, "data", "raw-messages", "all_messages_combined.json"), "r", encoding="utf-8") as f:
data = json.load(f)
feishu_re = re.compile(r"https?://[a-zA-Z0-9.-]+\.feishu\.cn/(?:wiki|docx)/[A-Za-z0-9]+")
# Find feishu links shared around the same time as garden world discussions (05-25 to 06-02)
print("=== 05-25~06-02 期间 dc群所有飞书链接 ===")
for msg in data["dc"]:
t = msg.get("createTime", "")
if t >= "2026-05-25" and t <= "2026-06-02":
content = msg.get("content", "")
links = feishu_re.findall(content)
if links:
sender = msg.get("sender", "")
for link in links:
print(" [%s] %s: %s" % (t[:10], sender, link))
# Also find the chat content around 05-25 to 06-02 for garden world discussions
print("\n=== 05-25~06-02 期间 dc群非链接讨论 ===")
for msg in data["dc"]:
t = msg.get("createTime", "")
if t >= "2026-05-25" and t <= "2026-06-02":
content = msg.get("content", "")
if not feishu_re.search(content) and not content.startswith("[文件]") and not content.startswith("[图片") and not content.startswith("[视频") and len(content) > 10:
sender = msg.get("sender", "")
print(" [%s] %s: %s" % (t[:16], sender, content[:200]))