Created
February 7, 2022 19:29
-
-
Save thesmartcoder123/163e407c0e0fe0338458b41be456b322 to your computer and use it in GitHub Desktop.
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
const sleep = (ms) => new Promise(r => setTimeout(r, ms)); | |
(async () => { | |
const box = prompt('What is the box you would like to open my buddy? (EXAMPLE: Safari)'); | |
const amount = prompt('How many boxes do you want to open?'); | |
const response = await fetch('https://api.blooket.com/api/users/verify-token', { credentials: "include" }); | |
const data = await response.json(); | |
(new Promise(async (res, rej) => { | |
var blooks = []; | |
for (let i = 0; i < amount; i++) { | |
await sleep(100); | |
fetch('https://api.blooket.com/api/users/unlockblook', { | |
method: "PUT", | |
headers: { | |
"accept": "application/json, text/plain, */*", | |
"accept-language": "en-US,en;q=0.9,ru;q=0.8", | |
}, | |
credentials: "include", | |
body: JSON.stringify({ | |
box: box, | |
name: data.name, | |
}), | |
}).then(r => { | |
if (r.status == 200) r.json().then(r => blooks.push(r.unlockedBlook)); | |
}); | |
}; | |
res(blooks); | |
})).then(blooks => { | |
let count = {}; | |
blooks.forEach((i) => { count[i] = (count[i] || 0) + 1; }); | |
alert(`Results:\n` + Object.entries(count).map((x) => ` ${x[2]} ${x[0]}`).join(`\n`)); | |
}); | |
})(); |
bruh
const sleep = (ms) => new Promise(r => setTimeout(r, ms));
(async () => {
const box = prompt('What is the box you would like to open my buddy? (EXAMPLE: Safari)');
const amount = prompt('How many boxes do you want to open?');
const response = await fetch('https://api.blooket.com/api/users/verify-token', { credentials: "include" });
const data = await response.json();
(new Promise(async (res, rej) => {
var blooks = [];
for (let i = 0; i < amount; i++) {
await sleep(100);
fetch('https://api.blooket.com/api/users/unlockblook', {
method: "PUT",
headers: {
"accept": "application/json, text/plain, */*",
"accept-language": "en-US,en;q=0.9,ru;q=0.8",
},
credentials: "include",
body: JSON.stringify({
box: box,
name: data.name,
}),
}).then(r => {
if (r.status == 200) r.json().then(r => blooks.push(r.unlockedBlook));
});
};
res(blooks);
})).then(blooks => {
let count = {};
blooks.forEach((i) => { count[i] = (count[i] || 0) + 1; });
alert(`Results:\n` + Object.entries(count).map((x) => ` ${x[2]} ${x[0]}`).join(`\n`));
});
})();
gkuqxgfsxertbjwe4qy
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
i still dont know what to do