Rishabh-malhotraa / caucus

Realtime Collaborate Editor with Embedded Compiler
https://caucus.rishabhmalhotra.in/
MIT License
295 stars 70 forks source link

Add support for codechef Problem URL #43

Open Rishabh-malhotraa opened 2 years ago

Rishabh-malhotraa commented 2 years ago

Requirement

Currently, Caucus only supports codeforces and atcoder links, but it would be great to add support for CodeChef links.

image

Files to be modified

ujju20 commented 2 years ago

Can I work on this issue?

Rishabh-malhotraa commented 2 years ago

Can I work on this issue?

Go ahead, if you need any help hmu on discord.

ujju20 commented 2 years ago

Can I work on this issue?

Go ahead, if you need any help hmu on discord.

Sure

starkkumarkk1611 commented 2 years ago

Hi, @Rishabh-malhotraa CodeChef API is restricted. It means I have to do it with Pure Web scraping. I would Like to do it with npm package jsdom.

Rishabh-malhotraa commented 2 years ago

Hi, @Rishabh-malhotraa CodeChef API is restricted. It means I have to do it with Pure Web scraping. I would Like to do it with npm package jsdom.

Yes, @starkkumarkk1611 CodeChef does not have a public API that gives us access to question, we need to make a get request to the problem page, parse the HTML and select only those div which encloses the questions.

You can look at how its implemented here in caucus-server.

We use cheerio.js for parsing and traversing the dom elements

starkkumarkk1611 commented 2 years ago

Thanks I will give my to implement this feature

Rishabh-malhotraa commented 2 years ago

@starkkumarkk1611 If you haven't started coding this, maybe take a similar issue #52, which adds the feature to load cses problems instead of this one as @ujju20 is also working on this.

starkkumarkk1611 commented 2 years ago

@starkkumarkk1611 If you haven't started coding this, maybe take a similar issue #52, which adds the feature to load cses problems instead of this one as @ujju20 is also working on this.

thanks I will work on issue #52,