ChessTempo ECF Rating Estimate

Add estimated ECF rating to ChessTempo statistics page.

目前为 2014-06-06 提交的版本。查看 最新版本

// ==UserScript==
// @name        ChessTempo ECF Rating Estimate
// @namespace   http://xyxyx.org/
// @include     http://chesstempo.com/chess-statistics.html*
// @version     1
// @grant       none
// @description Add estimated ECF rating to ChessTempo statistics page.
// ==/UserScript==

var regex = new RegExp(/FIDE Estimated Rating based on standard tactics: (\d+)/);

var summaryChildren = document.getElementById("summaryTab").childNodes;

try {

    for (var i = 0; i < summaryChildren.length; i++) {
        var child = summaryChildren.item(i);
        //console.log("child " + i + " = " + child);
        var data = child.data;
        
        if (data) {
            // console.log("data = " + data);
            var match = regex.exec(data);
            
            if (match && match.length > 1) {
               var rating = match[1];
                console.log("FIDE: " + rating);
                var ecf = Math.round((rating-650)/8);
                console.log ("ECF: " + ecf);
                child.data += " (ECF: " + ecf + ")";
            }
        }
    }
    
} catch (e) {
    console.log("Error: " + e);
}

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址