腾讯围棋分享出来的链接:
https://huanle.qq.com/act/a20170110wq/index-photo.html?type=1&chess=0200002200110000000202002022112100000000220202212211220000220000022211110200020002002022221120002202020221111120000012222221101012000001111121012022120000012221111200012000200011102200201200002112001002000100000000201211001220000002200022110011000002111002000200020000200001001120112000011000002020012000000000102202201200000000012211121000000000000000001000000
其实棋谱就在这一串书数字里,懒得去解析,可以直接分析网页源代码。
通过源代码就能看出每颗棋子的位置。
用Tampermonkey写一个脚本,就可以得到对应的棋谱了。
// ==UserScript==
// @name 腾讯围棋转谱
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match https://huanle.qq.com/act/*
// @grant none
// @require http://code.jquery.com/jquery-1.11.0.min.js
// ==/UserScript==(function() {'use strict';setTimeout(function () { load(); }, 2000);$(".comment_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);}
})();
执行效果