Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SPIKE]: Leetcode API Usage #513

Open
probro27 opened this issue Feb 18, 2024 · 1 comment
Open

[SPIKE]: Leetcode API Usage #513

probro27 opened this issue Feb 18, 2024 · 1 comment
Assignees
Labels
question Further information is requested

Comments

@probro27
Copy link
Contributor

probro27 commented Feb 18, 2024

We want to use Leetcode APIs to build an automated system for Weekly contests where if people solve certain questions they earn CodeyCoins.

This is a research task to figure out if Leetcode API has the features we need to actually build this, or if we need any separate third party API for this data.

The data we get from the user:

  • leetcode username/ profile url

The data we want to access:

  • Attempts on a particular question (Date + Time for the latest)
  • If they have solved the question (Date + Time for the latest)
  • Which language they solved the question in (optional)
  • Their solution speed and memory usage data (just take the latest) (optional)

Currently we are using the leetcode api here https://github.com/uwcsc/codeybot/blob/main/src/components/leetcode.ts

@probro27 probro27 added the question Further information is requested label Feb 18, 2024
@KuroganeToyama KuroganeToyama self-assigned this May 22, 2024
@KuroganeToyama
Copy link
Contributor

I digged through several different repos and only managed to find one thing that would work.
https://github.com/alfaarghya/alfa-leetcode-api/blob/main/src/GQLQueries/contest.ts

I tested it on Postman. The query returns info on all past contests, but we can always filter out to grab the Weekly Contests ones. It doesn't give us info on specific questions, so my suggestion is that we can just simply reward CodeyCoin based on the number of questions they solved. Unfortunately, it doesn't give us info for the optional criteria you listed, but other than that, everything else looks promising.

Unfortunately again, I myself have never attempted a Weekly Contest (never really got the time) so it would be nice if you or someone else, who have attempted a Weekly Contest, to test out the query and check out the data. But I'm pretty confident about the query already.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants