-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathunlistAllItemsCSFloat.js
38 lines (38 loc) · 975 Bytes
/
unlistAllItemsCSFloat.js
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
fetch("https://csfloat.com/api/v1/me/listings", {
headers: {
accept: "application/json, text/plain, */*",
},
method: "GET",
mode: "cors",
credentials: "include",
})
.then((res) => res.json())
.then((json) => {
for (let listing of json) {
fetch(`https://csfloat.com/api/v1/listings/${listing.id}`, {
headers: {
accept: "application/json, text/plain, */*",
},
method: "DELETE",
mode: "cors",
credentials: "include",
})
.then((res) => {
if (res.status == 200) {
console.log(
`${listing.item.market_hash_name} deslistado com sucesso!`
);
}
})
.catch((err) => {
console.log(err);
console.log(
`Erro ou delistar o item ${listing.item.market_hash_name}`
);
});
}
})
.catch((err) => {
console.log(err);
console.log("Houve um erro inesperado!");
});