Last active
March 1, 2025 08:28
-
-
Save jkmartindale/c2a2cb83e6a2e889c7e3aa7b37b5fedc 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
This file contains hidden or 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
/* Twitch Quest Fixer v3.1 */ | |
const extensionID = "ehc5ey5g9hoehi8ys54lr6eknomqgr"; | |
const channel = location.pathname.slice(1).toLowerCase(); | |
const channelId = __APOLLO_CLIENT__.cache.data.data.ROOT_QUERY["channel({\"name\":\""+channel+"\"})"].__ref.split(":")[1]; | |
const pollDuration = 60000; | |
let authToken = __APOLLO_CLIENT__.cache.data.data["Channel:" + channelId].selfInstalledExtensions.filter(x => x.helixToken.extensionID == extensionID)[0].token.jwt; | |
grantPermission = async () => { | |
console.log("Attempting to grant permission automatically..."); | |
const integrityResponse = await (await fetch("https://gql.twitch.tv/integrity", { method: "post", headers: commonOptions.headers })).json(); | |
const integrity = integrityResponse.token; | |
const permissionResponse = await (await fetch("https://gql.twitch.tv/gql", { | |
method: "post", | |
headers: { | |
...commonOptions.headers, ...{ | |
"Client-Integrity": integrity | |
} | |
}, | |
body: JSON.stringify([{ | |
"operationName": "LinkUserMutation", | |
"variables": { | |
"channelID": channelId, | |
"extensionID": extensionID, | |
"token": authToken, | |
"showUser": true | |
}, | |
"extensions": { "persistedQuery": { "version": 1, "sha256Hash": "b5dfec96759d42ac5a24f79beec27bcdf90e936e0fac4f727b7ab36dadb6a22a" } } | |
}]) | |
})).json(); | |
console.log(permissionResponse); | |
newAuthToken = permissionResponse[0].data.extensionLinkUser.token.jwt; | |
if (newAuthToken) { | |
authToken = newAuthToken; | |
console.log("Looks like permission was successfully granted. You should see another message saying that you're earning ARP about 60 seconds from now."); | |
}; | |
} | |
handlePolling = () => { | |
fetch("https://alienware.jkmartindale.dev/?url=https://www.alienwarearena.com/twitch/extensions/track", { | |
method: 'GET', | |
headers: { | |
'x-extension-jwt': authToken, | |
'x-extension-channel': channelId | |
} | |
}) | |
.then(response => response.json()) | |
.then(async data => { | |
console.log(data); | |
/* Attempt to authorize extension if not authorized */ | |
if (data.state === "grant_permission") { | |
await grantPermission(); | |
}; | |
}) | |
.catch((err) => { | |
console.log(err); | |
}) | |
.finally(() => { | |
setTimeout(handlePolling, pollDuration); | |
}); | |
}; | |
handlePolling() |
I don't have a screenshot, I'll try to get one tonight. but it was working
fine with Chrome and Edge, just not Firefox. It appears that it depends on
the streamer and what type of widget they're using, as you mentioned
before. With Fooya, it wouldn't work in Firefox, but it did work with
another streamer that I tried.
…On Fri, Feb 28, 2025 at 5:36 AM James Martindale ***@***.***> wrote:
***@***.**** commented on this gist.
------------------------------
Uncaught ReferenceError: APOLLO_CLIENT is not defined
Looks like Twitch just changed something that broke how API queries are
handled. Honestly surprised that code worked as long as it did because it
was a bit of a hack. I'm AFK on international travel for a bit but I'll
take a look eventually. I'm honestly surprised people still feel a need to
use this.
Can you send a screenshot of the AWA panel? Just curious what it's saying
that is making you try this ancient script.
—
Reply to this email directly, view it on GitHub
<https://gist.github.com/jkmartindale/c2a2cb83e6a2e889c7e3aa7b37b5fedc#gistcomment-5461018>
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABIDQ56MTOF7TVEBXKG7CP32SA32VBFKMF2HI4TJMJ2XIZLTSKBKK5TBNR2WLJDUOJ2WLJDOMFWWLO3UNBZGKYLEL5YGC4TUNFRWS4DBNZ2F6YLDORUXM2LUPGBKK5TBNR2WLJDHNFZXJJDOMFWWLK3UNBZGKYLEL52HS4DFVRZXKYTKMVRXIX3UPFYGLK2HNFZXIQ3PNVWWK3TUUZ2G64DJMNZZDAVEOR4XAZNEM5UXG5FFOZQWY5LFVEYTEMBXHE3TMOBWU52HE2LHM5SXFJTDOJSWC5DF>
.
You are receiving this email because you commented on the thread.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>
.
Uncaught ReferenceError: APOLLO_CLIENT is not defined
at :4:19
i cant see success message and i cannot take ARP anymore.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Looks like Twitch just changed something that broke how API queries are handled. Honestly surprised that code worked as long as it did because it was a bit of a hack. I'm AFK on international travel for a bit but I'll take a look eventually. I'm honestly surprised people still feel a need to use this.
Can you send a screenshot of the AWA panel? Just curious what it's saying that is making you try this ancient script.