Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // 1) Go to https://play.google.com/store/account/orderhistory
- // 2) make sure you are logged in and scroll down and click show more untill you reach your first purchase
- // 3) open dev console (f12 for chrome)
- // 4) paste code into console and run it
- // 5) if it does not work with an error or comes out to 0 and you know there is more than that then
- // 1) open inspect element
- // 2) hover over one of the purchases prices and click on it
- // 3) copy the class name and paste it for the value of purchaseTag (img: https://imgur.com/a/yVuiuh9)
- // Optional: if you want dokkan only then get the tags for both the parrent and img divs along with the url for dokkan
- // parrent tag (img: https://imgur.com/a/EbqE5tw)
- // img tag (img: https://imgur.com/a/xkoO6IA)
- // url src, for this one you will have to copy the src url from the right hand dev console
- // it will look like this (img: https://imgur.com/a/bCiH4Ul)
- let purchaseTag = "mshXob";
- let checkDokkanOnly = true;
- let imageParrentTag = "U6fuTe";
- let imageTag = "RqCJic";
- let dokkanImgUrl = "https://play-lh.googleusercontent.com/mIzmQg5skIphSPvcd4xGPZ9bPHi7ZymqXKMDL-SpdHOIVWl1kU2X4qq1SJQ8mKYAnjw=s50-rw"
- function hasSomeParentTheClass(element, classname) {
- // RqCJic
- if (element.className != null && element.className.split(' ').indexOf(classname)>=0) {
- let elle = element.firstChild
- if (elle.className.split(' ').indexOf(imageTag)>=0) {
- if (elle.firstChild.src == dokkanImgUrl)
- return true
- }
- };
- return element.parentNode && hasSomeParentTheClass(element.parentNode, classname);
- }
- var totalAmount = 0.0
- var elems = document.getElementsByClassName(purchaseTag), i;
- for (var i = 0; i < elems.length; ++i) {
- var text = elems[i].innerText
- if (text && (checkDokkanOnly && hasSomeParentTheClass(elems[i], imageParrentTag))) {
- text = text.replace(",",".") // European-style conversion
- text = text.replace(":",".") // Swedish krona conversion
- appPrice = parseFloat(Number(text.replace(/[^0-9\.]+/g,"")))
- if (!isNaN(appPrice)){
- totalAmount = totalAmount + appPrice
- }
- }
- }
- alert('Total amount spent on apps: ' + totalAmount.toFixed(2))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement