-
Notifications
You must be signed in to change notification settings - Fork 1
/
Blooket 500 tokens
44 lines (37 loc) · 1.19 KB
/
Blooket 500 tokens
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
easync function getName() {
const response = await fetch('https://api.blooket.com/api/users/verify-token', {
method: "GET",
headers: {
"accept": "application/json, text/plain, */*",
"accept-language": "en-US,en;q=0.9,ru;q=0.8",
},
credentials: "include"
});
const data = await response.json();
return data.name;
};
async function addCurrencies() {
const tokens = Number(prompt('How many tokens do you want to add to your account? (500 daily)'));
if (tokens > 500) {
alert('You can only add up to 500 tokens a day you cheater .');
};
const response = await fetch('https://api.blooket.com/api/users/add-rewards', {
method: "PUT",
headers: {
"referer": "https://www.blooket.com/",
"content-type": "application/json",
},
credentials: "include",
body: JSON.stringify({
addedTokens: tokens,
addedXp: 300,
name: await getName()
})
});
if (response.status == 200) {
alert(`${tokens} tokens and 300 XP added to your account!`);
} else {
alert('An error occured.');
};
};
addCurrencies();