Advertisement
Xerxes468894

Untitled

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