BinanceCNY

显示法定币价

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         BinanceCNY
// @namespace    https://www.binance.com/
// @version      0.3
// @description  显示法定币价
// @author       Shevckcccc
// @match        https://www.binance.com/trade.html?symbol=*
// ==/UserScript==

(function() {
    'use strict';
    setInterval(function(){
        var current_price = parseFloat($('.kline-para ul li strong').eq(0).text());
        var country_price = parseFloat($('.kline-para ul li strong').eq(1).text().replace(/[^0-9\.]/g, ''));
        var unit_price = country_price / current_price;

        var asks = $('#askScrollBox .askTable tr .f-left .ng-binding span');
        asks.each(function (index, item) {
            var origin_price = item.innerText.split('|')[0];
            var price = parseFloat(origin_price * unit_price).toFixed(2);
            $(item).text(origin_price + '|' + price);
        });

        var bids = $('#bidScrollBox .bidTable tr .f-left .ng-binding span');
        bids.each(function (index, item) {
            var origin_price = item.innerText.split('|')[0];
            var price = parseFloat(origin_price * unit_price).toFixed(2);
            $(item).text(origin_price + '|' + price);
        });
    }, 2000);
})();