NOTICE: By continued use of this site you understand and agree to the binding Terms of Service and Privacy Policy.
// ==UserScript==
// @name Binance IOTA to DKK converter
// @namespace http://tampermonkey.net/
// @version 0.91
// @updateURL https://openuserjs.org/meta/nicoeg/Binance_IOTA_to_DKK_converter.meta.js
// @copyright 2017, nicoeg (https://openuserjs.org/users/nicoeg)
// @description try to take over the world!
// @author You
// @match https://www.binance.com/tradeDetail.html*
// @grant none
// @require https://cdnjs.cloudflare.com/ajax/libs/jquery-animateNumber/0.0.14/jquery.animateNumber.min.js
// @license MIT
// ==/UserScript==
(function() {
'use strict';
var dkkRate = null;
$('.orderform-type').first().append('<span style="float:right;" id="ms"></span>');
$('.depthbg .f-right').remove();
$('.depthbg .f-left').css({ 'display': 'flex', 'justify-content': 'space-between'});
$('.depthbg .f-left').append('<strong class="transMoney" id="onedkk"></strong>');
$('#chart_container').append('<div id="dkk"><span></span>,-</div>');
$('#chart_container').css({positition: 'relative'});
$('#dkk').css({
'position': 'absolute',
'fontSize': '200px',
'top': '0',
'bottom': '0',
'left': '0',
'right': '0',
'margin': 'auto',
'textAlign': 'center',
'fontWeight': 'bold',
'opacity': '0.3',
'display': 'none',
'justifyContent': 'center',
'alignItems': 'center',
});
$.get('https://api.fixer.io/latest?symbols=DKK&base=usd', null, function(res) {
dkkRate = res.rates.DKK;
getPrice(dkkRate);
setInterval(function() {
getPrice(dkkRate);
}, 1000);
});
function getPrice(dkkRate) {
var coins = parseFloat($('.trade-div:nth-child(2) .f-fr').first().text().replace('IOTA Balance: ', ''));
var dollar = parseFloat($('.transMoney').html().replace('$', ''));
var danish = Math.round(coins * dollar * dkkRate * 100) / 100;
if (!dollar) {
return;
}
$('#onedkk').html(Math.round(dollar * dkkRate * 100) / 100 + ',-');
if (coins) {
$('#dkk').fadeIn().css({display: 'flex'});
$('#dkk span').prop('number', $('#dkk span').html()).animateNumber({ number: danish });
$('#ms').html(Math.round(danish / (18.95 / 5)) + ' mælkesnitter');
}
}
})();