Skip to content

Instantly share code, notes, and snippets.

@divinity76
Last active July 30, 2019 16:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save divinity76/27af01e22cb62532236c61a32383693a to your computer and use it in GitHub Desktop.
Save divinity76/27af01e22cb62532236c61a32383693a to your computer and use it in GitHub Desktop.
total bills on online.net https://console.online.net/en/bill/list
// execute on https://console.online.net/en/bill/list
(function(){
const rex=/^\s*(?<amount>\d+(?:\.\d+)?)\s*\€\s*$/;
// rex.exec(text).groups.amount
let total=0;
$("table:last >> tr:not(:first) > td:nth-child(5)").each(function(){
const plus=rex.exec(this.textContent).groups.amount;
console.log(plus);
total+=Number(plus);
});
return total;
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment