← 返回 Skills 市场
lfp1979

知网论文下载

作者 lfp1979 · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ⚠ suspicious
34
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install cnki-download
功能描述
从中国知网(CNKI,中南大学图书馆代理入口)检索并批量下载学术文献 PDF。一句话触发:"知网下载"、"cnki 下载"、"帮我下几篇知网文献"。负责:用自然语言收集参数(关键词/篇数/筛选/排序)→ 启动 Playwright+Edge pipeline →第一次会手动登录,登录态保留在 `browser_d...
使用说明 (SKILL.md)

CNKI 知网下载

什么时候用

用户说「知网下载」「cnki 下载」「帮我下几篇知网文献」「从知网搜点论文」时直接用本 skill。

第 0 步:启动前 agent 自检(用户不用动手脚)

不要让用户自己去 npm install、装 Node、装 Edge —— 全部由 agent 跑前自检、自行装好。

启动脚本前依次跑下面 4 项检查,全部 ✅ 才进入工作流第 1 步:

  1. Node 可用node --version 能输出 v18+。如果不通过,提示用户装 Node 后由 agent 重试。
  2. Edge 可用:检测 C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exeC:\Program Files\Microsoft\Edge\Application\msedge.exe 是否存在。缺失则提示用户装 Microsoft Edge(https://www.microsoft.com/edge)。
  3. Playwright 可用且版本够:在 scripts/ 目录下跑 node -e "import('playwright').then(m=>process.exit(0)).catch(e=>process.exit(1))",exit 0 即通过。Node 会沿父目录向上找 node_modules/,所以 workspace 根目录已装的 playwright 也能复用。
  4. Playwright 不够/缺失时:自己跑 npm install重要:执行时设环境变量 PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1(这个 skill 用的是系统 Edge,不需要再下载 playwright 自带的 chromium,能省几百 MB)。
    cd C:\Users\lfp\.openclaw\workspace\skills\cnki-download\scripts
    $env:PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD = "1"
    npm install
    

自检全通过后告诉用户「环境 OK,开始干」,再进入第 1 步反问参数。

如果用户第一次说"知网下载"时已经在聊天里走了一段时间了,先做这 4 步自检再问参数 —— 自检可能也要十几秒,提前跑能省一次往返。


工作流(agent 视角)

1. 收到「知网下载」触发 → 先建议 demo 试跑

不要一上来就问一堆参数。用一段话先建议 demo 试跑,小白用户可以先看到完整流程怎么走的(demo 关键词是「区块链」,下载 5 篇,筛选北大核心/CSSCI + 2024-2025 年)。

示范话术:

「好的,知网下载。在开始之前,要不要先用 demo 跑一下测试

demo 用的是内置默认配置:关键词『区块链』、北大核心 + CSSCI、2024-2025 年、下载 5 篇。

请选择 : 1、跑demo 2、自定义检索下载

  • 重要提示:
  • - 第一次会手动登录,后续几个小时内不需要再登录
    - 我会开启一个新的终端窗口,后续的指令和提示会在新窗口进行输出(主要涉及用户登录);
    - 登录以后请 **自行链接** 到知网搜索页面,搜索将自动进行
    - 用最醒目的字体颜色提醒用户:  download文件保存的绝对路径
    

  • 用户选 1 → 直接
  • 在当前技能目录下启动
  • Start-Process powershell -ArgumentList "-NoExit", "-Command", "node scripts/search_cnki.js"
  • 用户选 2 → 跳到第 2 步。

2. 补全缺失参数

按下面 4 项问清楚:

「好,自定义检索。请告诉我:

  1. 检索关键词?(必填)
  2. 下载几篇?(必填,默认 5)
  3. 要不要筛选
  4. 要不要排序? 明确提示可以指定的筛选与排序字段见 references/config-schema.md

不筛不排的话只回关键词和篇数也行,剩下的我用默认。」

3. 写一份 config JSON

把用户的回答翻译成 config,写到一个临时文件,比如 scripts/_user-config-{YYYYMMDD-HHmm}.json

{
  "keyword": "\x3C用户说的关键词>",
  "download_count": \x3C用户说的篇数>,
  "sort":   { "field": "\x3C相关度|发表时间|被引|下载|综合>", "order": "\x3CDESC|ASC>" },   // 可选
  "filters": [ { "col": "...", "values": ["..."] } ]                                   // 可选
}

只有 keyworddownload_count 是必填。

4. 启动 pipeline

// 在当前技能目录下启动
`Start-Process powershell -ArgumentList "-NoExit", "-Command", "node scripts/search_cnki.js \x3Cconfig 路径>"` 

exec与process工具调用规定:

通过exec执行node脚本后,会打开一个新的进程和新窗口,把控制权完全交给它,不要一直查看进程状态,直接结束。

关键约束

  • 不要自己用 browser 工具去探 CNKI(已经有 Playwright 跑着了),避免多开冲突
  • 不要修改 scripts/ 下的脚本;如发现 bug 写进 references/troubleshooting.md 等用户决定
  • 不要让用户自己装 Node / Edge / 跑 npm install(agent 全包,见第 0 步)
  • 不要browser_data/ / download/ / _login_state.png 提交进 git(参考 references/troubleshooting.md.gitignore 写法)

相关文件

  • references/config-schema.md —— config 字段详情、枚举值、3 种调用方式
  • assets/default-config.json —— 默认 demo(node scripts/search_cnki.js 不带参数就用这个的 hard-coded 等价物)
安全使用建议
Install only if you are comfortable with a local Node/Playwright workflow that can install dependencies, open Edge, store CNKI/library session cookies in browser_data, and save search configs and PDFs on disk. Run it from a dedicated account or workspace, review the exact npm install and node commands first, and delete browser_data, temporary config files, screenshots, and downloads when finished.
能力评估
Purpose & Capability
The scripts coherently implement CNKI search, filtering, sorting, detail-page visits, and PDF downloads through Playwright and a CSU library proxy; no artifact-backed exfiltration or destructive behavior was found.
Instruction Scope
SKILL.md tells the agent to run the workflow in a new PowerShell window and then stop monitoring process status, which reduces auditability and user control over a browser automation flow using an authenticated session.
Install Mechanism
The skill instructs the agent to run npm install automatically when Playwright is missing. The dependency set is narrow and lockfile-backed, but the instruction explicitly avoids user involvement for a host-modifying package install.
Credentials
Windows, Node 18+, Edge, Playwright, network access to CNKI/CSU proxy, and local file writes are proportionate to the stated PDF download automation, though the workflow is not portable and should run only in an intended local environment.
Persistence & Privilege
The skill creates a persistent Playwright browser profile under browser_data and saves PDFs/configs under the skill directory; session persistence is disclosed, but there is no clear cleanup, retention, or protection guidance for cookies, search terms, and downloaded papers.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install cnki-download
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /cnki-download 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Initial release of cnki-download: batch download CNKI academic PDFs via CLI workflow. - Enables natural language parameter collection for searching and downloading PDFs from CNKI (via CSU library proxy). - Fully automates pre-checks for required environment (Node.js v18+, Edge, Playwright) and self-installs missing dependencies without user intervention. - Provides a demo mode with default search (e.g., keyword: “区块链”, recent core journals, 5 results) or supports user-defined search with customizable filters/sorting. - Launches downloads through a new terminal window, preserving login state for several hours after first manual login to CNKI. - Handles config creation, workflow prompts, and file saving; download folder path is clearly highlighted for users.
元数据
Slug cnki-download
版本 1.0.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

知网论文下载 是什么?

从中国知网(CNKI,中南大学图书馆代理入口)检索并批量下载学术文献 PDF。一句话触发:"知网下载"、"cnki 下载"、"帮我下几篇知网文献"。负责:用自然语言收集参数(关键词/篇数/筛选/排序)→ 启动 Playwright+Edge pipeline →第一次会手动登录,登录态保留在 `browser_d... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 34 次。

如何安装 知网论文下载?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install cnki-download」即可一键安装,无需额外配置。

知网论文下载 是免费的吗?

是的,知网论文下载 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

知网论文下载 支持哪些平台?

知网论文下载 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 知网论文下载?

由 lfp1979(@lfp1979)开发并维护,当前版本 v1.0.0。

💬 留言讨论