admin 管理员组文章数量: 1184232
腾讯围棋分享出来的链接:
https://huanle.qq/act/a20170110wq/index-photo.html?type=1&chess=0200002200110000000202002022112100000000220202212211220000220000022211110200020002002022221120002202020221111120000012222221101012000001111121012022120000012221111200012000200011102200201200002112001002000100000000201211001220000002200022110011000002111002000200020000200001001120112000011000002020012000000000102202201200000000012211121000000000000000001000000
其实棋谱就在这一串书数字里,懒得去解析,可以直接分析网页源代码。
通过源代码就能看出每颗棋子的位置。
用Tampermonkey写一个脚本,就可以得到对应的棋谱了。
// ==UserScript==
// @name 腾讯围棋转谱
// @namespace http://tampermonkey/
// @version 0.1
// @description try to take over the world!
// @author You
// @match https://huanle.qq/act/*
// @grant none
// @require http://code.jquery/jquery-1.11.0.min.js
// ==/UserScript==
(function() {
'use strict';
setTimeout(function () { load(); }, 2000);
$("ment_title1").append("<textarea id='qp' style='width:100%;height:100px'>棋谱生成中...</textarea>");
function load() {
var arr = "ABCEDFGHIJKLMNOPQRS";
var res = "(";
$("#gameView div").each(function () {
var left = $(this).css("left").replace("px", "") - 19;
var top = $(this).css("top").replace("px", "") - 19;
var x = arr[left / 38].toLowerCase();
var y = arr[top / 38].toLowerCase();
var c = $(this).attr("class") == "chessBlack" ? "B" : "W";
res += (c + "[" + x + y + "]") + ";"
});
res = res.substring(0, res.length - 1) + ")";
$("#qp").val( res);
}
})();
执行效果
版权声明:本文标题:QQ围棋棋谱 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.roclinux.cn/b/1763774431a3269015.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论