Last active
October 31, 2022 14:36
-
-
Save mksglu/a584ed209b20a0152c1a44d4d75a655e to your computer and use it in GitHub Desktop.
hepsiburada.com üzerinden yaptığınız toplam alışveriş tutarını gösterir. https://www.hepsiburada.com adresine girdikten sonra uye girisi yapin ve tarayicinin konsoluna asagidaki kodu yapistirip entere basmaniz yeterli.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fetch("https://www.hepsiburada.com/siparislerim/api/orders?skip=0").then(function(r){return r.json()}).then(function(r){var e=r.MaxSkip;if(0===e){for(var n=0,a=0;a<r.Orders.length;a++)n+=parseInt(r.Orders[a].TotalAmount.Value);console.log("Toplam Hepsiburada.com harcamaniz: ",n.toFixed(2).replace(/\d(?=(\d{3})+\.)/g,"$&,"),"TL")}else{(function(r,e){for(var n=[],a=0;a<r+e;a+=e)n.push(fetch("https://www.hepsiburada.com/siparislerim/api/orders?skip=".concat(a)).then(function(r){return r.json()}).then(function(r){for(var e=0,n=0;n<r.Orders.length;n++)e+=parseInt(r.Orders[n].TotalAmount.Value);return e}));return Promise.all(n)})(e,10).then(function(r){var e=r.reduce(function(r,e){return r+e},0).toFixed(2).replace(/\d(?=(\d{3})+\.)/g,"$&,");console.log("Toplam Hepsiburada.com harcamaniz: ",e,"TL")})}}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
unminify halini de paylasiyorum. kategorilere ayirmak isteyen felan olur belki.
https://gist.github.com/mksglu/3ad0ddbf2b9f1393430aaae6106846a8