Created
September 26, 2023 16:40
-
-
Save zisra/33314a86a6346ecb16559b2df4008fa1 to your computer and use it in GitHub Desktop.
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
const lessonUUID = window.location.pathname.split("/")[2]; | |
const sleep = (m) => new Promise((r) => setTimeout(r, m)); | |
fetch( | |
`https://api.garbanzo.io/api/assignment/${lessonUUID}?localized_date_time=2023-09-14%2011:31:06`, | |
{ | |
headers: { | |
authorization: localStorage.getItem("auth._token.local"), | |
}, | |
method: "GET", | |
}, | |
).then(async (res) => { | |
const { data } = await res.json(); | |
for (step of data.steps) { | |
const lesson = await fetch( | |
`https://api.garbanzo.io/api/assignment/${lessonUUID}/step/${step.uuid}/`, | |
{ | |
headers: { | |
authorization: localStorage.getItem("auth._token.local"), | |
}, | |
method: "POST", | |
}, | |
); | |
const lessonData = await lesson.json(); | |
if (lessonData.message) { | |
console.log(lessonData.message); | |
} | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment