Skip to content

Instantly share code, notes, and snippets.

@the-pesar
Created August 6, 2025 15:29
Show Gist options
  • Save the-pesar/5e0b29e6d94b1fbe463b71c77fb90ec5 to your computer and use it in GitHub Desktop.
Save the-pesar/5e0b29e6d94b1fbe463b71c77fb90ec5 to your computer and use it in GitHub Desktop.
script.js
(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);
}
})();
@arashnm80
Copy link

❤️❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment