Last active
February 3, 2025 14:43
-
-
Save avrahamy/20e7b6c3c2a497141166fbe28b85ab75 to your computer and use it in GitHub Desktop.
Query Steam keys. Based on: https://gist.github.com/petersvp/270f7d5d7d548448f4897586a0d389c0
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
keys = ` | |
PASTE-KEYSS-HEREE | |
PASTE-KEYSS-HEREE | |
PASTE-KEYSS-HEREE | |
` | |
var keylist = keys.split("\n"); | |
for (let i=0; i<keylist.length; i+=200) { | |
keylist.slice(i, i+200).forEach(key => { | |
if(key.length<17) return; | |
function reqListener () { | |
let body = this.responseText; | |
let result = body.split('<h2>Activation Details</h2>')[1]; | |
if (!result) { | |
console.log('Error quering CD Key ' + key); | |
return; | |
} | |
result = result.split('</table>')[0]; | |
result = result.match(/<td>.*<\/td>/g); | |
result = result.map(function (line) { | |
return line.replace(/<[^>]*>/g, ''); | |
}); | |
let line = [key, (result[0] === 'Activated') ? '"' + result[1] + '"' : result[0]].join('\t'); | |
console.log(line); | |
} | |
var oReq = new XMLHttpRequest(); | |
oReq.addEventListener("load", reqListener); | |
oReq.open("GET", "https://partner.steamgames.com/querycdkey/cdkey?cdkey="+key+"&method=Query"); | |
oReq.send(); | |
}); | |
await new Promise(r => setTimeout(r, 10000)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment