mirror of https://github.com/jackwener/wx-cli.git
* feat(biz): add biz-articles command to query public account messages
加载 biz_message_0.db 提取公众号推送(标题/url/作者/时间)。
- daemon 端通过 DbCache 按需解密 biz_message_0.db(密钥已在 all_keys.json 中)
- 新增 IPC 变体 BizArticles(limit/account/since/until 参数)
- 新增 query 处理器 q_biz_articles:
- 通过 Name2Id 反查 gh_* username → md5 → Msg_<hash> 表映射
- 过滤 local_type & 0xFFFFFFFF = 49(appmsg 公众号文章)
- zstd 解压 + extract_cdata 解析 <mmreader>/<item> XML
- 支持多文章推送(一条消息含多篇文章)
- 输出字段:time/timestamp/recv_time/account/account_username/title/url/digest/cover_url
- 新增 CLI 子命令 wx biz-articles,参数:-n / --account / --since / --until / --json
- 新增工具函数 extract_cdata(CDATA 块解析)和 parse_biz_xml_items
- 新增 8 个单测(biz_tests 模块)覆盖 CDATA 解析和多文章场景
支持工作流:
wx biz-articles --since today --json | jq ".[].url" | xargs opencli weixin download
Verified: 返朴 ADHD 文章、Datawhale Claude Code 文章、土猛员外知识引擎文章均已正确提取。
* feat(biz-articles): add --unread filter (one latest article per account)
只列「有未读的公众号」的最近 1 篇文章 — 与 'wx unread --filter official'
行为一致,便于扫描"哪些公众号还有未读,标题是啥"。
- ipc.rs: BizArticles 加 unread: bool 字段(serde default = false 向后兼容)
- cli/mod.rs: --unread flag
- cli/biz_articles.rs: 透传 unread
- daemon/server.rs: dispatch 加 unread 参数
- daemon/query.rs: q_biz_articles
- 开启 --unread 时先查 session.db 拿 unread_count>0 且
chat_type==official_account 的 username 集合
- 与 --account 取交集(两者都给时进一步缩小范围)
- 空交集提前 return,避免无意义全表扫
- 解析后按 pub_time DESC 排,每个 account_username 只保留首条
- 最后再 truncate(limit)
* docs: PR draft - update --unread + --until usage
* chore(biz-articles): drop PR draft, document command, fix typo
- 删除 PR_DRAFT.md(误入 repo 的 PR 描述草稿,不该进 main)
- README.md / SKILL.md 补 biz-articles 用法
- query.rs: 密鑰 → 密钥
Co-authored-by: wx-cli-coder <coder@example.com>
---------
Co-authored-by: jackwener <jakevingoo@gmail.com>
Co-authored-by: wx-cli-coder <coder@example.com>
|
||
|---|---|---|
| .. | ||
| biz_articles.rs | ||
| contacts.rs | ||
| daemon_cmd.rs | ||
| export.rs | ||
| favorites.rs | ||
| history.rs | ||
| init.rs | ||
| members.rs | ||
| mod.rs | ||
| new_messages.rs | ||
| output.rs | ||
| search.rs | ||
| sessions.rs | ||
| sns_feed.rs | ||
| sns_notifications.rs | ||
| sns_search.rs | ||
| stats.rs | ||
| transport.rs | ||
| unread.rs | ||