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

Add support for LeetCode #415

Open
wingkwong opened this issue Jul 24, 2020 · 14 comments
Open

Add support for LeetCode #415

wingkwong opened this issue Jul 24, 2020 · 14 comments

Comments

@wingkwong
Copy link

Please add submissions of LeetCode(problemset and contests) too. Thanks

@PriyalsantoshJain
Copy link

@wingkwong can I take up this issue?

@wingkwong
Copy link
Author

@PriyalsantoshJain I'm not the owner of this repo. Better wait for @raj454raj to endorse first.

@PriyalsantoshJain
Copy link

@wingkwong sure.

@raj454raj
Copy link
Member

Hey @PriyalsantoshJain you can take this up if Leetcode supports public submissions page or an API. Don't think this can be picked until then

@Rajan-226
Copy link

Hey, Is anyone working on this?

@ShriyasnhAgarwl
Copy link

@raj454raj Please add the submissions of leetcode too. It will be indeed helpful.

@manoharreddyporeddy
Copy link

@raj454raj

Is public submissions page or an API below one - for example?
https://leetcode.com/contest/weekly-contest-306/ranking
If yes, yes, it has API to get all data for contests & users submissions using a script, can be seen easily via Chrome incognito mode.

FYI - @PriyalsantoshJain if you want to help implement

@ShriyasnhAgarwl
Copy link

ShriyasnhAgarwl commented Aug 19, 2022 via email

@manoharreddyporeddy
Copy link

Also clist.by is already doing:
https://clist.by/account/uwi/resource/leetcode.com/

@raj454raj
Copy link
Member

Hey @manoharreddyporeddy @ShriyasnhAgarwl

We need to get "ALL" the submissions given a handle of the user. If you're logged in to Leetcode, try opening this page - https://leetcode.com/submissions/#/1.

The same history is not available on a logged out state. Just getting the counts is not enough. Let me know if I am missing some API which gives this.

@manoharreddyporeddy
Copy link

Hey @raj454raj

1
Please clearly state ( bold/underline/etc ) what programming websites that stopstalk supports, at https://www.stopstalk.com/

===

Stay motivated by seeing your friends competitive programming progress. Add friends to see their submissions on various Competitive Programming websites (currently Codeforces, Codechef, Spoj, HackerEarth, HackerRank, UVa).

===

2
Many join to see https://leetcode.com/ but it does not support yet, and are disappointed after registering.
The discussion here to submit the information on What We Know in an attempt to support leetcode.com, and somehow enable that platform too now or in future

@manoharreddyporeddy
Copy link

For a user ( example uwi , https://leetcode.com/uwi/ )

  1. API for public Recent Accepted Submissions are below
  2. Looks like the limit in the Payload, may be increased to a large value to get all Accepted values

===

https://leetcode.com/graphql/

Payload

{
    "query": "\n    query recentAcSubmissions($username: String!, $limit: Int!) {\n  recentAcSubmissionList(username: $username, limit: $limit) {\n    id\n    title\n    titleSlug\n    timestamp\n  }\n}\n    ",
    "variables": {
        "username": "uwi",
        "limit": 15
    }
}

Response

{
    "data": {
        "recentAcSubmissionList": [
            {
                "id": "779035448",
                "title": "Find the K-Sum of an Array",
                "titleSlug": "find-the-k-sum-of-an-array",
                "timestamp": "1661050111"
            },
            {
                "id": "779026429",
                "title": "Amount of Time for Binary Tree to Be Infected",
                "titleSlug": "amount-of-time-for-binary-tree-to-be-infected",
                "timestamp": "1661049650"
            },
            {
                "id": "779022476",
                "title": "Minimum Hours of Training to Win a Competition",
                "titleSlug": "minimum-hours-of-training-to-win-a-competition",
                "timestamp": "1661049401"
            },
            {
                "id": "779020545",
                "title": "Largest Palindromic Number",
                "titleSlug": "largest-palindromic-number",
                "timestamp": "1661049211"
            },
            {
                "id": "778573571",
                "title": "Maximum Segment Sum After Removals",
                "titleSlug": "maximum-segment-sum-after-removals",
                "timestamp": "1661006474"
            },
            {
                "id": "778567076",
                "title": "Shifting Letters II",
                "titleSlug": "shifting-letters-ii",
                "timestamp": "1661006197"
            },
            {
                "id": "778563405",
                "title": "Time Needed to Rearrange a Binary String",
                "titleSlug": "time-needed-to-rearrange-a-binary-string",
                "timestamp": "1661006035"
            },
            {
                "id": "778561125",
                "title": "Minimum Recolors to Get K Consecutive Black Blocks",
                "titleSlug": "minimum-recolors-to-get-k-consecutive-black-blocks",
                "timestamp": "1661005891"
            },
            {
                "id": "773048358",
                "title": "Count Special Integers",
                "titleSlug": "count-special-integers",
                "timestamp": "1660444794"
            },
            {
                "id": "773042460",
                "title": "Construct Smallest Number From DI String",
                "titleSlug": "construct-smallest-number-from-di-string",
                "timestamp": "1660444512"
            },
            {
                "id": "773040422",
                "title": "Node With Highest Edge Score",
                "titleSlug": "node-with-highest-edge-score",
                "timestamp": "1660444374"
            },
            {
                "id": "773039698",
                "title": "Largest Local Values in a Matrix",
                "titleSlug": "largest-local-values-in-a-matrix",
                "timestamp": "1660444285"
            },
            {
                "id": "766708840",
                "title": "Minimum Replacements to Sort the Array",
                "titleSlug": "minimum-replacements-to-sort-the-array",
                "timestamp": "1659797050"
            },
            {
                "id": "766698616",
                "title": "Merge Similar Items",
                "titleSlug": "merge-similar-items",
                "timestamp": "1659796613"
            },
            {
                "id": "766695309",
                "title": "Count Number of Bad Pairs",
                "titleSlug": "count-number-of-bad-pairs",
                "timestamp": "1659796486"
            }
        ]
    }
}

===

NOTE:

PROCEDURE to get above like information is below:
. When on user page like https://leetcode.com/uwi/
. Press F12 (in chrome browser on Windows)
. Now refresh the user page, & see "Network"

===

thanks for trying

@PriyalsantoshJain , @ShriyasnhAgarwl

@raj454raj
Copy link
Member

Hey @manoharreddyporeddy,

Thank you for your detailed inputs

API for public Recent Accepted Submissions are below

I did check this API. The problem with this is only "Accepted" submissions. Also the "limit" is capped at 20, try calling it with 30.

Stay motivated by seeing your friends competitive programming progress. Add friends to see their submissions on various Competitive Programming websites (currently Codeforces, Codechef, Spoj, HackerEarth, HackerRank, UVa).

Have updated this list now.

@MusfiqDehan
Copy link

Hey @raj454raj ,

A brother has created an API for many Competitive Programming Platforms including Leetcode. Using this API, we can check the total problem solved on LeetCode. Please check the links below. Hopefully, it will be useful for you.

Here is the Repository Link:
https://github.com/Abhijeet-AR/Competitive_Programming_Score_API

Here is a link for LeetCode API:
https://competitive-coding-api.herokuapp.com/api/leetcode/{user_name}

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

No branches or pull requests

7 participants