Yash-Parsana / CrazyCoderServerlessApi

This is backend api of CrazyCoder App which serves realtime data from various platforms through web scraping hosted on Netlify Serverless function. CrazyCoder App: https://github.com/Yash-Parsana/CrazyCoderApp | CrazyCoder website : https://crazycoder-eight.vercel.app
https://play.google.com/store/apps/details?id=com.parsanatech.crazycoder
16 stars 15 forks source link

GFG contest schedule route added #22

Closed kart2004 closed 1 month ago

kart2004 commented 1 month ago

This commit fixes #11 : Expose route for gfg contest This is the final result when I tested on local host:

image

I have made one major change to scheduleController.js in order to add the gfgSchedule function and I've made minor changes elsewhere too ensure the route works

image

Yash-Parsana commented 1 month ago

@kart2004 can you please resolve the conflicts and describe the approach in brief. i see while and for loop there what is the use of those loops?

kart2004 commented 1 month ago

Hi @Yash-Parsana, sorry for the late reply. It uses, practiceapi.geeksforgeeks.org, which is associated with the practice and contest platforms of gfg. From here it fetches the contest data and then sends JSON response in the required format after processing. The while(true) loop is used to continuously fetch data page by page. The for loop is to iterate over all contests, put timestamp for start and end, determine the status ('upcoming' or 'ongoing') . It does this because we need the ongoing data but the past data(from the url) also includes finished contests which we do not want.