Greasy Fork 还支持 简体中文。

SM - Convert automatically balance to usd

Balance -> USD.

  1. // ==UserScript==
  2. // @name SM - Convert automatically balance to usd
  3. // @namespace Hash G.
  4. // @description Balance -> USD.
  5. // @include *satoshimines.com*
  6. // @require http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js
  7. // @version 1.0
  8. // @grant GM_getValue
  9. // @grant GM_setValue
  10. // @grant GM_deleteValue
  11. // @grant GM_xmlhttpRequest
  12. // ==/UserScript==
  13.  
  14. var balance, btcAPI, usd;
  15.  
  16. $(document).bind("DOMSubtreeModified", function() {
  17. $(".balance > div:nth-child(1) > div:nth-child(1), #start_game, .cashout").on("click", function (){
  18. GM_xmlhttpRequest({
  19. method: "GET",
  20. url: "http://hashg.xyz/OMC-Rates/a.php",
  21. onload: function(response) {
  22. var responseText = response.responseText;
  23. var splittedResponse = responseText.split(":");
  24. btcAPI = splittedResponse[0] / 1000000;
  25. balance = $(".num").html();
  26. usd = btcAPI * balance;
  27. $(".balance > div:nth-child(1) > div:nth-child(1)").append("<span id='usdvalue'></span>");
  28. $("#usdvalue").html("= $" + usd.toFixed(3));
  29. }
  30. });
  31. });
  32. });