您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Add a button to generate a citation badge and copy it to clipboard on Semantic Scholar website pages, based on the article ID in the URL. The badge shows the citation count for the article. It generates an API URL with the citation count and copies it to clipboard.
当前为
// ==UserScript== // @name Semantic Scholar Citation Badge Generator // @namespace http://tampermonkey.net/ // @version 1 // @description Add a button to generate a citation badge and copy it to clipboard on Semantic Scholar website pages, based on the article ID in the URL. The badge shows the citation count for the article. It generates an API URL with the citation count and copies it to clipboard. // @match https://www.semanticscholar.org/* // @grant GM_setClipboard // @license MIT // ==/UserScript== (function() { 'use strict'; // 获取当前页面 URL 的最后一段字符串 const urlLastPart = window.location.pathname.split('/').pop(); // 生成 API URL const apiUrl = `https://img.shields.io/badge/dynamic/json?label=citation&query=citationCount&url=https://api.semanticscholar.org/graph/v1/paper/${urlLastPart}?fields=citationCount`; // 创建要保存到剪贴板的字符串 const clipboardStr = ``; // 添加按钮到页面 const button = document.createElement('button'); button.style.position = 'fixed'; button.style.top = '100px'; button.style.left = '20px'; button.textContent = 'Generate Citation Badge'; button.addEventListener('click', () => { GM_setClipboard(clipboardStr); button.textContent = 'Citation Badge Copied!'; window.setTimeout(() => { button.textContent = 'Generate Citation Badge'; }, 1000); // 1秒钟后将按钮文本更改回 "Generate Citation Badge" }); document.body.appendChild(button); })();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址