Task Functions
task()
The task
function contains the core logic of the task and we will update the code sample on the template with the code block below:
Let's break down the logic above, we:
Launched a browser using Puppeteer, created anew page and visited Google doodle
Parsed the HTML document with Cheerio
Extracted the link of the latest google doodle from the parsed HTML document
Converted the link to JSON and stored it on levelDB using the
storeSet
helper function
fetchSubmission()
The fetchSubmission
function with fetch and return the value from levelDB using the storeGet
helper function.
submitTask()
The submitTask
function calls the fetchSubmission()
to retrieve the value from levelDB and submits it to K2 using the checkSubmissionAndUpdateRound
helper function.
Last updated