Skip to content

Instantly share code, notes, and snippets.

@vanowm
Created December 29, 2023 01:34
Show Gist options
  • Save vanowm/837e9de8d76a63e1bca2dd31c826e37f to your computer and use it in GitHub Desktop.
Save vanowm/837e9de8d76a63e1bca2dd31c826e37f to your computer and use it in GitHub Desktop.
Epic games transactions counter
// Snippet to run at https://www.epicgames.com/account/transactions?lang=en-US&productName=egs&historyType=PAYMENT_HISTORY
{
let count = 0, elTitle = document.getElementById("transaction-history-view-title"), title = elTitle.textContent,
loop = page => fetch("https://www.epicgames.com/account/v2/payment/ajaxGetOrderHistory?nextPageToken=" + page).then(data => data.json()).then(data =>
{
elTitle.textContent = title + " (" + (count += data.orders.length) + ")";
data.nextPageToken && loop(data.nextPageToken, count, elTitle, title);
});
loop();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment