Skip to content

Instantly share code, notes, and snippets.

@AndyShade
Forked from jkmartindale/awa-twitch.js
Created August 11, 2024 09:59
Show Gist options
  • Select an option

  • Save AndyShade/c31d76a19f28f63e4895d53963f7da1a to your computer and use it in GitHub Desktop.

Select an option

Save AndyShade/c31d76a19f28f63e4895d53963f7da1a to your computer and use it in GitHub Desktop.
Paste this into your browser console to hopefully start earning rewards. Forum thread: https://web.archive.org/web/20230922092451/https%3A%2F%2Fna.alienwarearena.com%2Fucf%2Fshow%2F2167631
var channelId = __APOLLO_CLIENT__.cache.data.data.ROOT_QUERY[`channel({\"name\":\"${location.pathname.slice(1).toLowerCase()}\"})`].__ref.split(":")[1]
var authToken = __APOLLO_CLIENT__.cache.data.data[`Channel:${channelId}`].selfInstalledExtensions.filter(x=>x.helixToken.extensionID=="ehc5ey5g9hoehi8ys54lr6eknomqgr")[0].token.jwt
const pollDuration = 60000;
handlePolling = () => {
fetch(`https://www.alienwarearena.com/twitch/extensions/track`, {
method: 'GET',
headers: {
'x-extension-jwt': authToken,
'x-extension-channel': channelId
}
})
.then(response => response.json())
.then(data => {
console.log(data);
})
.catch((err) => {
console.log(err);
})
.finally(() => {
setTimeout(handlePolling, pollDuration);
});
}
handlePolling()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment