Greasy Fork

Greasy Fork is available in English.

知网空间跳转知网页面

知网空间(为搜索引擎优化的)跳转知网内部页面(适合人类阅读的)

目前为 2020-05-19 提交的版本,查看 最新版本

// ==UserScript==
// @name         知网空间跳转知网页面
// @namespace    xyz.tree0.a.cnki.cnki2cnki
// @version      0.1
// @description  知网空间(为搜索引擎优化的)跳转知网内部页面(适合人类阅读的)
// @author       an_anthony
// @match        http://*.cnki.com.cn/Article/*.htm
// @grant        none
// ==/UserScript==

(function() {
    'use strict';
    var DbUrl = window.location.href.substr(window.location.href.lastIndexOf('/')+ 1);
    var DbCode = DbUrl.split('-')[0].toUpperCase().replace("TOTAL","");
    var DbFileName = DbUrl.split('-')[1].substring(0,DbUrl.split('-')[1].indexOf('.'));

    //如果是硕博 还需要加上.nh
    DbFileName = DbFileName + (DbCode.toUpperCase()==="CMFD"?".nh":"");

    DbUrl = "/KCMS/detail/detail.aspx?DbCode=" + DbCode + "&FileName=" + DbFileName;

    $("#down_1").before("<div class='xx_font' ><a href='https://kns.cnki.net" + DbUrl + "' target='_self'>【知网详情】</a>&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;<a href='https://x.cnki.net" + DbUrl + "' target='_self'>【知网研学】</a></div>");

})();