skygragon / leetcode-cli

A cli tool to enjoy leetcode!
MIT License
3.65k stars 459 forks source link

submit not receive time beat ratio any more #156

Open zcmartian opened 5 years ago

zcmartian commented 5 years ago

when i use submit command, it doesn't reveive time beat ratio any more. instead i receive a message saying "[WARN] Failed to get submission beat ratio."

smrook commented 5 years ago

leetcode has changed the chart field name. In plugins/leetcode.js on line 339, need to update re = body.match(/distribution_formatted:\s('[^']+')/); to re = body.match(/runtimeDistributionFormatted:\s('[^']+')/);

Another suggestion is to include the distribution bucket of the submission itself while counting the beating percentile to make it more align with what we see from the web page, which is in commands/submit.js on line 79, change if (parseFloat(score[0]) > myRuntime) to if (parseFloat(score[0]) >= myRuntime)

Thanks~

skygragon commented 5 years ago

@smrook sounds great! would you mind sharing your fixes in the next release?

ketankr9 commented 5 years ago

I am still facing this issue.

[WARN] Failed to get submission beat ratio.

Could someone please release a new All In One binary. Thanks

cosmozhang commented 5 years ago

Same bug here.

edte commented 2 years ago

same bug here