forked from awmpietro/dolar-nubank
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.min.js
More file actions
1 lines (1 loc) · 1.86 KB
/
main.min.js
File metadata and controls
1 lines (1 loc) · 1.86 KB
1
const _0x4815=["#venda","BRL","#calculate-btn","cotacaoVenda","getJSON","length","MM-DD-YYYY","#total","BRL","days","#data","HH:mm:ss","#dolar","none","dataHoraCotacao","toLocaleString","#dolarInfo","LoadingOverlay","html","value","css","val","currency","'&$top=100&$format=json&$select=cotacaoCompra,cotacaoVenda,dataHoraCotacao","DD/MM/YYYY"," às ","https://olinda.bcb.gov.br/olinda/servico/PTAX/versao/v1/odata/CotacaoDolarDia(dataCotacao=@dataCotacao)?@dataCotacao='","pt-BR","display","show","hide","format","subtract"];!function(x,a){!function(a){for(;--a;)x.push(x.shift())}(++a)}(_0x4815,478);const _0x49e5=function(x,a){return _0x4815[x-=0]};!function(x){x(_0x49e5("0x0")).css(_0x49e5("0xc"),_0x49e5("0x1e")),x(_0x49e5("0x13")).click(function(){getData()})}(jQuery);const getData=async()=>{$[_0x49e5("0x1")](_0x49e5("0xd"));let x=[],a=0;for(;0===x[_0x49e5("0x16")];)x=await fetchData(a),a++;$.LoadingOverlay(_0x49e5("0xe")),$(_0x49e5("0x0"))[_0x49e5("0x4")](_0x49e5("0xc"),"block");let e=$(_0x49e5("0x1d"))[_0x49e5("0x5")]()*x[0][_0x49e5("0x14")],t=e+e/100*1,o=(t/100*6.38+t)[_0x49e5("0x20")](_0x49e5("0xb"),{minimumFractionDigits:2,style:_0x49e5("0x6"),currency:_0x49e5("0x12")});$(_0x49e5("0x18"))[_0x49e5("0x5")](o),$(_0x49e5("0x1b")).html(moment(x[0].dataHoraCotacao)[_0x49e5("0xf")](_0x49e5("0x8"))+_0x49e5("0x9")+moment(x[0][_0x49e5("0x1f")])[_0x49e5("0xf")](_0x49e5("0x1c"))),$("#compra")[_0x49e5("0x2")](x[0].cotacaoCompra[_0x49e5("0x20")](_0x49e5("0xb"),{minimumFractionDigits:4,style:_0x49e5("0x6"),currency:_0x49e5("0x19")})),$(_0x49e5("0x11"))[_0x49e5("0x2")](x[0][_0x49e5("0x14")][_0x49e5("0x20")](_0x49e5("0xb"),{minimumFractionDigits:4,style:_0x49e5("0x6"),currency:_0x49e5("0x19")}))},fetchData=async x=>{let a=moment()[_0x49e5("0x10")](x,_0x49e5("0x1a"))[_0x49e5("0xf")](_0x49e5("0x17")),e=_0x49e5("0xa")+a+_0x49e5("0x7");return(await $[_0x49e5("0x15")](e))[_0x49e5("0x3")]};