Skip to content

Instantly share code, notes, and snippets.

@avrahamy
Last active February 3, 2025 14:43
Show Gist options
  • Save avrahamy/20e7b6c3c2a497141166fbe28b85ab75 to your computer and use it in GitHub Desktop.
Save avrahamy/20e7b6c3c2a497141166fbe28b85ab75 to your computer and use it in GitHub Desktop.
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