mcpField
G
gs-fulltext

gs-fulltext

github.com/cookjohn生产力538291 次安装33 周前更新
代码仓库

关于 gs-fulltext

gs-fulltext 用于查找并整理 Google Scholar 论文的全文访问选项,适合文献检索流程。它可利用先前搜索结果中的链接,也可从结果页面提取链接。

主要功能

  1. 01收集全文与出版商链接
  2. 02按结果编号或 data-cid 定位论文
  3. 03整理直达链接和出版商页面
  4. 04可打开选定的全文链接

适用场景

  1. 01查找可用的 PDF 或 HTML 版本
  2. 02查看搜索结果的访问选项
  3. 03定位论文后打开全文

MCP 相关

该技能使用 Chrome DevTools MCP 工具检查 Google Scholar 结果,并可选择在新页面打开链接。

安装

复制下面的命令,在终端中运行。

$npx skills add https://github.com/cookjohn/gs-skills --skill gs-fulltext

安装后在 Claude Code 中输入/gs-fulltext确认已加载。

详细介绍

Google Scholar 全文访问

解析并呈现 Google Scholar 搜索结果中论文的所有全文访问选项。

参数

$ARGUMENTS 可以是:

  • 之前搜索结果中的 data-cid
  • 指代之前搜索结果的结果编号(例如,3)

前提条件

此技能最好在之前调用 gs-search 或 gs-advanced-search 后使用,这些调用已提取每条结果的 fullTextUrl 和 href。如果这些信息可用,请直接使用。

步骤

步骤 1:从搜索结果中收集链接

从之前的搜索结果中,提取目标论文的以下字段:

  • fullTextUrl:直接 PDF/HTML 链接(来自 .gs_ggs a)
  • href:论文的出版商页面链接(来自 .gs_rt a)
  • dataCid:集群 ID

如果没有之前的搜索上下文,请先使用 gs-search 搜索论文。

步骤 2:解析其他链接(evaluate_script)

导航到 Google Scholar 结果页面(如果尚未在该页面),然后提取对应论文的全文链接:

async () => {
  const cid = "DATA_CID_HERE";

  // Find the result item by data-cid
  const item = document.querySelector(`.gs_r.gs_or.gs_scl[data-cid="${cid}"]`);
  if (!item) return { error: 'not_found', message: 'Paper not found on current page. Try searching again.' };

  const titleEl = item.querySelector('.gs_rt a');
  const title = titleEl?.textContent?.trim() || item.querySelector('.gs_rt')?.textContent?.trim() || '';
  const paperUrl = titleEl?.href || '';

  // Full-text PDF/HTML link (shown on the right side of results)
  const fullTextEl = item.querySelector('.gs_ggs a') || item.querySelector('.gs_or_ggsm a');
  const fullTextUrl = fullTextEl?.href || '';
  const fullTextType = fullTextEl?.querySelector('span.gs_ctg2')?.textContent?.trim() || '';

  // Meta info for context
  const meta = item.querySelector('.gs_a')?.textContent || '';
  const parts = meta.split(' - ');
  const authors = parts[0]?.trim() || '';
  const journalYear = parts[1]?.trim() || '';

  // Try to extract DOI from paper URL
  let doi = '';
  if (paperUrl.includes('doi.org/')) {
    doi = paperUrl.replace(/^https?:\/\/(dx\.)?doi\.org\//, '');
  }

  // Build access links
  const links = {};

  if (fullTextUrl) {
    links.fullText = fullTextUrl;
    links.fullTextType = fullTextType || (fullTextUrl.endsWith('.pdf') ? '[PDF]' : '[HTML]');
  }

  if (paperUrl) {
    links.publisher = paperUrl;
  }

  if (doi) {
    links.doi = `https://doi.org/${doi}`;
    links.scihub = `https://sci-hub.ru/${doi}`;
  } else if (paperUrl) {
    // Sci-Hub also works with direct URLs
    links.scihub = `https://sci-hub.ru/${paperUrl}`;
  }

  return {
    dataCid: cid,
    title,
    authors,
    journalYear,
    doi,
    fullTextUrl,
    fullTextType,
    paperUrl,
    links
  };
}
步骤 3:报告
## Full Text Links — {title}

**Authors:** {authors} | {journalYear}

**Direct Full Text:**
{links.fullText ? "- " + links.fullTextType + " " + links.fullText : "No direct full text link available"}

**Publisher Page:**
{links.publisher ? "- " + links.publisher : "N/A"}

**DOI:**
{links.doi ? "- " + links.doi : "No DOI detected"}

**Sci-Hub:**
{links.scihub ? "- " + links.scihub : "N/A"}
步骤 4:打开全文(可选)

如果用户想立即阅读论文,请使用 mcp__chrome-devtools__new_page 按以下优先顺序打开首选链接:

  1. fullTextUrl(直接 PDF/HTML,通常免费)
  2. DOI 链接(可能需要订阅)
  3. Sci-Hub 链接(备用)
  4. 出版商页面

备注

  • 此技能使用 1–2 次工具调用:evaluate_script(如果已在结果页面上),或 navigate_page + evaluate_script
  • Google Scholar 的全文链接(.gs_ggs)通常是免费/开放获取的 PDF
  • 论文 URL 中不一定总能提取出 DOI
  • Sci-Hub 支持 DOI 和直接 URL
  • 在新标签页中打开全文会额外增加 1 次工具调用(new_page)

评论

支持 Markdown