Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Find out how much you've spent on apps in the Google Play Store
- *
- * INSTRUCTIONS - read this first!
- *
- * It Only works for a single currency, because it adds up the number values.
- *
- * 1. Go to https://play.google.com/store/account
- * 2. Scroll all the way to the bottom of the "my orders" page in the Play Store. Click every "show more" button and keep scrolling. It loads the content dynamically while scrolling and gets stuck sometimes. Try scrolling up and down a few times, that triggers a reload of the other items.
- * 3. Your very first order/install should now be visible at the bottom of the table.
- * 4. Paste the code in your browser's developer console. In Chrome for Mac press Option+Command+J. Another way is: right click > inspect element > console tab > paste full code
- * 5. Press enter and see your result.
- */
- var totalAmount = 0.0
- $('.list-table').find('tr').each(function() {
- var isCancelled = $(this).find('.purchase-status').find('div').hasClass('history-canceled')
- var isApp = $(this).hasClass('app')
- if (isApp && !isCancelled) {
- var text = $(this).find('.purchase-price').text()
- 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