Skills

Cnki Export

Export paper from CNKI and push to Zotero, or save as RIS file.

Install

npx skills add cookjohn/cnki-skills --skill cnki-export -g -a claude-code -y
Category
Engineering
Updated
8mo ago
License
See repository
Context cost
Mediumabout 1,617 tokens
Runs scripts
Yes, review before use

What it does

Export paper from CNKI and push to Zotero, or save as RIS file. Use when user wants to save a paper to Zotero or export citation data.

CNKI Export & Zotero Integration

Export paper citation data from CNKI and push directly to Zotero, or save as RIS file.

Arguments

  • zotero (default), push to Zotero desktop via local API
  • ris, save as .ris file
  • gb, output GB/T 7714 citation text
  • Optionally include a paper URL

Mode Selection

Choose the right mode based on context:

ContextModeTool calls
On a paper detail pageSingle export (Step 1A)1 evaluate + 1 bash = 2
On a search results page, save all/selectedBatch export (Step 1B)1 evaluate + 1 bash = 2
Need to search then saveUse cnki-search first, then batch export4 total

Always prefer batch export (1B) when multiple papers need saving. It avoids navigating to each detail page (saves ~3 calls per paper).

Steps

1A. Single export: from paper detail page

Use mcp__chrome-devtools__evaluate_script:

async () => {
  const url = document.querySelector('#export-url')?.value;
  const params = document.querySelector('#export-id')?.value;
  const uniplatform = new URLSearchParams(window.location.search).get('uniplatform') || 'NZKPT';
  if (!url || !params) return { error: 'Not on a paper detail page' };

  const resp = await fetch(url, {
    method: 'POST',
    headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
    body: new URLSearchParams({ filename: params, displaymode: 'GBTREFER,elearning,EndNote', uniplatform })
  });
  const data = await resp.json();
  if (data.code !== 1) return { error: data.msg };

  const result = {};
  for (const item of data.data) {
    result[item.mode] = item.value[0];
  }
Read the whole SKILL.md on GitHub

More in Engineering