Skip to content

Instantly share code, notes, and snippets.

@Amirjavadzadee
Last active September 29, 2024 19:57
Show Gist options
  • Save Amirjavadzadee/7a226a66c77a35dfc17b575750eaca98 to your computer and use it in GitHub Desktop.
Save Amirjavadzadee/7a226a66c77a35dfc17b575750eaca98 to your computer and use it in GitHub Desktop.
const headers = {
Authorization: "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyIjoiNjZlNDJiODg0YzIxYTcxZWI5Njg5ZjhiIiwiaWF0IjoxNzI3NjM3ODQ2LCJleHAiOjE3Mjc3MjQyNDYsInR5cGUiOiJhY2Nlc3MifQ.-bi6Tv2yeabyr4esHJa0VxV_cFqcHVXxcgFWOv4pb2w", // replace your token here
}
async function delay(ms) {
return new Promise((reslove) => setTimeout(() => reslove(true), ms))
}
async function getMissions() {
const res = await fetch("https://api-mission.goatsbot.xyz/missions/user", {
headers,
})
const data = await res.json()
return Object.values(data).flat(1)
}
async function completeAllOfMissions(missions) {
for (let i = 0; i < missions.length; i++) {
const res = await fetch(
`https://dev-api.goatsbot.xyz/missions/action/${missions[i]._id}`,
{
method: "POST",
headers,
}
)
console.log(i, res.status)
await delay(500)
}
}
async function viewAdv() {
const res = await fetch(
"https://dev-api.goatsbot.xyz/missions/action/66db47e2ff88e4527783327e",
{ method: "POST", headers }
)
const data = await res.json()
console.log("adv -", data.status ?? data.message)
}
async function makeMoney() {
const missions = await getMissions()
await completeAllOfMissions(missions)
await viewAdv()
setInterval(viewAdv, 60000)
}
makeMoney()
console.log("excuted: started...")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment