caucus icon indicating copy to clipboard operation
caucus copied to clipboard

Add support for codechef Problem URL

Open Rishabh-malhotraa opened this issue 3 years ago • 8 comments

Requirement

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

  • Changes need to be made in the caucus server to add the functionality to scrape the CodeChef question from the get response. Also, some UI changes in the front-end, to tell the user that we support CodeChef links.

image

Files to be modified

Rishabh-malhotraa avatar Oct 05 '21 02:10 Rishabh-malhotraa

Can I work on this issue?

ujju20 avatar Oct 05 '21 09:10 ujju20

Can I work on this issue?

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

Rishabh-malhotraa avatar Oct 05 '21 10:10 Rishabh-malhotraa

Can I work on this issue?

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

Sure

ujju20 avatar Oct 05 '21 10:10 ujju20

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.

starkkumarkk1611 avatar Oct 05 '21 11:10 starkkumarkk1611

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

Rishabh-malhotraa avatar Oct 05 '21 12:10 Rishabh-malhotraa

Thanks I will give my to implement this feature

starkkumarkk1611 avatar Oct 05 '21 12:10 starkkumarkk1611

@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.

Rishabh-malhotraa avatar Oct 05 '21 15:10 Rishabh-malhotraa

@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,

starkkumarkk1611 avatar Oct 05 '21 15:10 starkkumarkk1611