Created
December 29, 2023 01:34
-
-
Save vanowm/837e9de8d76a63e1bca2dd31c826e37f to your computer and use it in GitHub Desktop.
Epic games transactions counter
This file contains 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
// 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