油猴(tampermonkey)脚本:
// ==UserScript==
// @name zhouyi
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match http://www.quanxue.cn/CT_RuJia/ZhouYi/*
// @grant GM_setClipboard
// @require http://code.jquery.com/jquery-3.3.1.min.js
// ==/UserScript==
var $ = window.jQuery;
function writeToNewWin( content ){
//var x=window.open();
//x.document.open();
//x.document.write(content);
GM_setClipboard(content);
//x.document.close();
}
var h=$('.title3').text()+' '+$('.title4').text();
var gc=$('.guaci').text();
var yc=$('.yaoci').text();
yc=yc.replace(/\n$/,'');
yc=yc.replace(/\n/g,"\n</li>\n<li>");
$('.tuan').children('big').remove();
var tuan=$('.tuan').text().replace("\n","");
$('.xiang').children(".yin").remove();
$('.xiang').children('big').remove();
var xiang=$('.xiang').text();
xiang=xiang.replace("\n", "");
xiang=xiang.replace(/\n{2}/g,"\n");
var o=`<div :class="{ disabled: guaOrder != '0' }">`;
o+="\n<h2>"+h+"</h2>\n";
o+="<div class='guaci'>\n"+gc+"</div>";
o+="\n<h3>爻辞(周公)</h3>\n";
o+="<div class='yaoci'>\n<ul>\n<li>"+yc+"</li>\n</ul>\n</div>\n";
o+="<div class='tuan'>\n彖曰: "+tuan+"</div>";
o+="\n<h3>卦象(伏羲)</h3>\n";
o+="<div class='xiang'>\n象曰: "+xiang+"</div>\n";
o+=`<h3>卦辞(文王)</h3>
<div class='wenyan'>
文言曰:
</div>
<h3>易传(孔子)</h3>
<div class='kongzi'>
</div>\n</div>\n\n`
writeToNewWin( o );
console.log(yc);
网友评论