Skip to content

Instantly share code, notes, and snippets.

@petele
Last active February 2, 2022 18:53
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save petele/6834305 to your computer and use it in GitHub Desktop.
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 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