HPOOL CHIA收益计算

2021/4/15下午3:32:44

当前为 2021-06-29 提交的版本,查看 最新版本

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name        HPOOL CHIA收益计算
// @namespace   Violentmonkey Scripts
// @match       *://hpool.co/statistics/chia*
// @grant       none
// @version     1.4
// @author      Edik
// @description 2021/4/15下午3:32:44
// @require    https://code.jquery.com/jquery-2.2.4.js
// ==/UserScript==

(function() {
  'use strict';
  
  document.addEventListener("DOMContentLoaded",startaa);

  startaa();

  function startaa(){
    
    $.get("https://www.hpool.co/api/pool/detail?language=zh&type=chia", function(result){
  
      let capacity = result.data.capacity
      
      let html = $($($('.stat-t').children()[2]).children()[2]).html()
      
      let num = html.substring(0,html.indexOf("<small"))
      
      
      let htmlNew = '<div><img src="/static/media/income.861e0a5700.png" alt=""><div class="mt15 d">日平均收益</div><h2>'+(num/1024).toFixed(6)+' <small>XCH/TB</small></h2></div>'

      $('.stat-t').append(htmlNew)
      
      htmlNew = '<div><img src="/static/media/income.861e0a5700.png" alt=""><div class="mt15 d">日总收益</div><h2>'+(num*capacity/1024/1024).toFixed(6)+' <small>XCH/'+(capacity/1024).toFixed(2)+'TB</small></h2></div>'

      $('.stat-t').append(htmlNew)
      
    });
    
  }

})();