Bitcoin Forum
October 06, 2024, 05:34:09 PM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Small platform improvement script  (Read 112 times)
sjonkeesse (OP)
Newbie
*
Offline Offline

Activity: 1
Merit: 0


View Profile
January 06, 2018, 06:23:14 PM
 #1

Hi there. For myself I needed some extra information within Bittrex. I wanted to see the worth of each currency in Euro's and also the total value in the Euro currency. For that I created the following script that you can automatically load within Bittrex with the Chrome CJS plugin.

Example of extra info:
https://i.imgur.com/0WEHENZ.jpg

Quote
var dollarToEuro = 1.20302;
 
function addEUR() {
    var btc = $('[data-bind="text:navigation.displayBitcoinUsd"]').text().substring(9);
 
    // To Table
    if (0 === $('#balanceTable td[colspan="9"]').length && 0 === $('#balanceTable .sjonkeesse').length) {
        var amount, euro;
      
        [].forEach.call($('#balanceTable tbody tr'), function(e) {
            amount = $(e).find('td:nth-child(Cool').text().trim();
            euro = Math.round(amount * btc / dollarToEuro * 100) / 100;
      
            $(e).append($(`<td class="sjonkeesse number">&euro; ${euro}</td>`));
        });
    }
 
    // To total
    var strTotal = $('#pad-wrapper h4').text();
 
    if (-1 === strTotal.indexOf("EUR")) {
        var totalBTC = strTotal.substr(17, strTotal.indexOf('BTC') - 18);
        var totalEUR = Math.round(totalBTC * btc / dollarToEuro * 100) / 100;
 
        $('#pad-wrapper h4').text(`${strTotal} / ${totalEUR} EUR 💰`);
    }
}
 
$(document).ready(function() {
    $('#balanceTable thead tr').append($('<th><span>EST. Euro</span></th>'));
 
    setInterval(function() {
        addEUR();
    }, 100);
});


To use this code you can install the Chrome plugin called CJS and then navigate to the Bittrex website. In the top right you will find the blue cjs icon. When you click on it you can enter the quoted code above and click on 'enable cjs for this host'. Then click on safe.

Chrome CJS Plugin: https://chrome.google.com/webstore/detail/custom-javascript-for-web/poakhlngfciodnhlhhgnaaelnpjljija


Note: Do not just use every code you get. Review it first to see if there is any malicious code!  Wink
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!