Created
August 6, 2025 15:29
-
-
Save the-pesar/5e0b29e6d94b1fbe463b71c77fb90ec5 to your computer and use it in GitHub Desktop.
script.js
This file contains hidden or 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
(async () => { | |
const headers = { | |
"API-Token": "token", | |
}; | |
const res = await fetch("https://api.giftomania.rocks/api/tasks", { | |
method: "GET", | |
headers, | |
}); | |
const data = await res.json(); | |
for (let i = 0; i < data.tasks.length; i++) { | |
const name = data.tasks[i].publicId; | |
const res2 = await fetch(`https://api.giftomania.rocks/api/tasks/${name}/complete`, { | |
method: "POST", | |
headers, | |
}); | |
const result = await res2.json(); | |
console.log(name, "-", result.message ?? result.details); | |
} | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
❤️❤️