← Back to Skills Marketplace
lfp1979

知网论文下载

by lfp1979 · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ⚠ suspicious
34
Downloads
0
Stars
0
Active Installs
1
Versions
Install in OpenClaw
/install cnki-download
Description
从中国知网(CNKI,中南大学图书馆代理入口)检索并批量下载学术文献 PDF。一句话触发:"知网下载"、"cnki 下载"、"帮我下几篇知网文献"。负责:用自然语言收集参数(关键词/篇数/筛选/排序)→ 启动 Playwright+Edge pipeline →第一次会手动登录,登录态保留在 `browser_d...
README (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 等价物)
Usage Guidance
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.
Capability Assessment
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.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install cnki-download
  3. After installation, invoke the skill by name or use /cnki-download
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
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.
Metadata
Slug cnki-download
Version 1.0.0
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 1
Frequently Asked Questions

What is 知网论文下载?

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

How do I install 知网论文下载?

Run "/install cnki-download" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is 知网论文下载 free?

Yes, 知网论文下载 is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does 知网论文下载 support?

知网论文下载 is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created 知网论文下载?

It is built and maintained by lfp1979 (@lfp1979); the current version is v1.0.0.

💬 Comments