-
Notifications
You must be signed in to change notification settings - Fork 1.3k
/
Free Tokens💰
33 lines (27 loc) · 1003 Bytes
/
Free 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
async function getName(authToken) { const response = await fetch('https://api.blooket.com/api/users/verify-token?token=JWT+' + authToken); 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? (10000 daily)')); const myToken = localStorage.token.split('JWT ')[1];
if (tokens > 10000) {
alert('You can add up to 10000 tokens daily.')
}
const response = await fetch('https://api.blooket.com/api/users/add-rewards', {
method: "PUT",
headers: {
"referer": "https://www.blooket.com/",
"content-type": "application/json",
"authorization": localStorage.token
},
body: JSON.stringify({
addedTokens: tokens,
addedXp: 300,
name: await getName(myToken)
})
});
if (response.status == 200) {
alert(`${tokens} tokens and 300 XP added to your account!`);
} else {
alert('An error occured.');
};
};
addCurrencies();