Compare commits

...

2 Commits

Author SHA1 Message Date
Jan Scheiper
51b57d570f Merge branch 'master' of git.literalchaos.de:jan/ipod-widget-server 2021-04-16 11:16:16 +02:00
Jan Scheiper
7f766a1653 switched out the defunct xmr.to with binance for xmr prices 2021-04-16 11:15:52 +02:00
3 changed files with 6 additions and 5 deletions

View File

@ -24,9 +24,10 @@ class XMRData extends EventEmitter {
axios.get("https://bitpay.com/api/rates/eur").catch(err => log.error(err.config.url, err.message)),
// axios.get("https://shapeshift.io/marketinfo/btc_xmr").catch(err => log.error(err.config.url, err.message)),
axios.get("https://api.morphtoken.com/rates").catch(err => log.error(err.config.url, err.message)),
axios.get("https://xmr.to/api/v3/xmr2btc/order_parameter_query/").catch(err => log.error(err.config.url, err.message)),
// axios.get("https://xmr.to/api/v2/xmr2btc/order_parameter_query/").catch(err => log.error(err.config.url, err.message)),
axios.get("https://api.binance.com/api/v3/ticker/price?symbol=XMRBTC").catch(err => log.error(err.config.url, err.message)),
]).then(resp => {
let bitpay = null, morphtoken = null, xmrto = null, morphtoken_xmr = null;
let bitpay = null, morphtoken = null, binance = null, morphtoken_xmr = null;
if (resp[0] != undefined) {
bitpay = resp[0].data.rate;
@ -38,11 +39,11 @@ class XMRData extends EventEmitter {
}
if (resp[2] != undefined) {
xmrto = (Math.round((bitpay * resp[2].data.price) * 100) / 100) + "€";
binance = (Math.round((bitpay * resp[2].data.price) * 100) / 100) + "€";
}
}
this.emit("data", { morphtoken, xmrto, morphtoken_xmr });
this.emit("data", { morphtoken, binance, morphtoken_xmr });
});
}
}

BIN
page/img/binance.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

View File

@ -107,7 +107,7 @@
</div>
<div class="databox">
<img class="icon" src="img/xmrto.png"><div class="data d-monero-xmrto">---</div>
<img class="icon" src="img/binance.png"><div class="data d-monero-binance">---</div>
</div>
</div>