Last active
February 2, 2022 18:53
-
-
Save petele/6834305 to your computer and use it in GitHub Desktop.
Want to know how much money you've spent on Seamless in your lifetime? Pop over to your Order History page (https://www.seamless.com/Food-Delivery/orderhistory.m), scroll all the way to the bottom so it stops loading any more results, then open the Console in the Chrome DevTools and paste this chunk of code in. Voila! The number of orders you've…
This file contains hidden or 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
| // This probably doesn't work anymore. | |
| let lines = ""; | |
| var orders = $("tbody#OrderHistoryLikedItem tr"); | |
| var count = 0; | |
| var amount = 0.0; | |
| for (var i = 0; i < orders.length; i++) { | |
| try { | |
| var tr = $(orders[i]); | |
| var d = tr.find("td.date strong")[0].innerText.trim(); | |
| var v = tr.find("td.vendor a")[0].innerText.trim(); | |
| var p = tr.find("td.total")[0].innerText.trim(); | |
| p = p.replace("$", ""); | |
| p = p.replace("(", "-"); | |
| p = p.replace(")", ""); | |
| amount += parseFloat(p, 10); | |
| count++; | |
| lines += d + "," + v + "," + p + "\n"; | |
| } catch (ex) { | |
| console.log("Error", ex); | |
| } | |
| } | |
| console.log(lines); | |
| console.log(count, amount); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment