text: "use strict"; const CROSSURL = "https://peaceful-mountain-17529.herokuapp.com/", fetchDataFromUrl = async (t, e) => { let n = CROSSURL + "?url=" + t, r = await fetch(n).then(t => t.text()), o = await (new DOMParser).parseFromString(r, "text/html"); return await ([...o.querySelectorAll(e)]) }; async function kakkuGetDSE() { let t = await fetchDataFromUrl("https://www.dsebd.org", "#mq2 table tr td table tr td"), e = []; if (t.length > 0) for (let n = 1; n <= t.length - 1; n++) { let r = t[n].innerText.split(/[\s]{1,}/), o = { name: r[0], lastTrade: r[1], changeAmount: r[2], changePercent: r[3] }; e.push(o) } else console.error("something wrong!! plz send report to who write this code with your Curse"); return e } async function kakkuGetCSE() { let t = await fetchDataFromUrl("https://www.cse.com.bd/ticker2.php", "#mq2 table tbody tr .priceticker"), e = []; if (t.length > 0) for (let n = 0; n <= t.length - 1; n++) { let r = t[n].querySelectorAll("td"), o = { name: r[0].innerText, f: r[1].innerText, l: r[2].innerText }; e.push(o) } else console.error("something wrong!! plz send report to who write this code with your Curse"); return e } async function kakkuGetDSEAll() { let t = await fetchDataFromUrl("https://www.dsebd.org/latest_share_price_all.php", "table tr"), e = []; if (t.length > 0) for (let n = 1; n <= t.length - 1; n++) { let r = t[n].querySelectorAll("td"), o = { no: r[0].innerText, tradingCode: r[1].innerText, ltp: r[2].innerText, high: r[3].innerText, low: r[4].innerText, closep: r[5].innerText, ycp: r[6].innerText, change: r[7].innerText, trade: r[8].innerText, value: r[9].innerText, volume: r[10].innerText }; e.push(o) } else console.error("something wrong!! plz send report to who write this code with your Curse"); return e } async function kakkuGetCSEAll() { let t = await fetchDataFromUrl("https://www.cse.com.bd/market/current_price", "#dataTable tbody tr"), e = []; if (t.length > 0) for (var n = 1; n <= t.length - 1; n++) { let r = t[n].querySelectorAll("td"), o = { no: r[0].innerText, tradingCode: r[1].innerText, ltp: r[2].innerText, open: r[3].innerText, high: r[4].innerText, low: r[5].innerText, ycp: r[6].innerText, trade: r[7].innerText, value: r[8].innerText, volume: r[9].innerText }; e.push(o) } else console.error("something wrong!! plz send report to who write this code with your Curse"); return e } function TemplateDSE(t = []) { if (0 === t.length) return; if (null == t.data || 0 == t.data.length) return; let e = document.querySelector(t.domEl); if (null === e) { throw new Error("Your Given ID/Class is Wrong") } let n = t.scrolldelay ? t.scrolldelay : 5, r = t.bg ? t.bg : "#49244e;", o = t.textColor ? t.textColor : "#333"; e.innerHTML = `<div class="dsetem1" style="background: ${r};color:${o}">\n\t\t<div class="dsetem-header">\n\t\t\tDSE\n\t\t</div>\n\t\t<marquee onMouseOver="this.stop()" onMouseOut="this.start()" loop="true" scrollamount="${n}">\n\t\t\t${t.data.map(t => { let e = t.changeAmount > 0 ? '<i class="upper">&#8679</i>' : "", n = t.changeAmount < 0 ? '<i class="lower">&#8681</i>' : "", r = 0 == t.changeAmount ? '<i class="middle">&#8691</i>' : ""; return `<span>\n\t\t\t\t\t\t${t.name} - ${t.lastTrade}\n\t\t\t\t\t\t<br> \n\t\t\t\t\t\t<code>${t.changePercent}</code> \n\t\t\t\t\t\t<code>${t.changeAmount}</code>\n\t\t\t\t\t\t${e} ${n} ${r}\n\t\t\t\t\t</span>` }).join("")}\n\t\t</marquee>\n \t</div>` } function TemplateCSE(t = []) { if (0 === t.length) return; if (null == t.data || 0 == t.data.length) return; let e = document.querySelector(t.domEl); if (null === e) { throw new Error("Your Given ID/Class is Wrong") } let n = t.scrolldelay ? t.scrolldelay : 5, r = t.bg ? t.bg : "#49244e;", o = t.textColor ? t.textColor : "#333"; e.innerHTML = `<div class="dsetem1" style="background: ${r};color:${o}">\n\t\t<div class="dsetem-header">\n\t\t\tCSE\n\t\t</div>\n\t\t<marquee onMouseOver="this.stop()" onMouseOut="this.start()" loop="true" scrollamount="${n}">\n\t\t\t${t.data.map(t => `<span>\n\t\t\t\t\t\t${t.name} ${t.f}\n\t\t\t\t\t\t<br> \n\t\t\t\t\t\t<code>${t.l}</code>\n\t\t\t\t\t</span>`).join("")}\n\t\t</marquee>\n \t</div>` }