// ==UserScript== // @name douban_opac // @namespace douban_opac // @description douban book links to XmuLibrary OPAC item // @include https://book.douban.com/subject/* // @include https://book.douban.com/isbn/* // @include http://book.douban.com/subject/* // @include http://book.douban.com/isbn/* // @author zhx@xmulib.org // @version v2.5 // @require http://libs.baidu.com/jquery/2.0.0/jquery.min.js // @grant GM_xmlhttpRequest // @downloadURL https://update.greasyfork.icu/scripts/18039/douban_opac.user.js // @updateURL https://update.greasyfork.icu/scripts/18039/douban_opac.meta.js // ==/UserScript== $(document).ready(function(){ var title = $('h1').text(); $("#info .pl").each(function(i){ if ($(this).text() == 'ISBN:'){ isbn = $(this)[0].nextSibling.nodeValue; isbn = isbn.substr(1,13); } }); var opacurl = 'http://210.34.4.28/api/getLOC.php?isbn='+isbn+'&title='+title; GM_xmlhttpRequest({ //获取列表 method : "GET", synchronous : false, url : opacurl, onload : function (ret) { item = ret.responseText; item_json = JSON.parse(item); if (item_json.marc_no != ""){ var opacLink = "http://210.34.4.28/opac/item.php?marc_no="+item.marc_no; var htmlStr = "