Dhanus3133 / Leetbuddy.nvim

Solve Leetcode problems within Neovim 🔥
MIT License
138 stars 15 forks source link

feat: add LBDailyQuestion command used to fetch daily question today #21

Open MSDimos opened 1 year ago

MSDimos commented 1 year ago

Hello Dhanus,

this plugin is very useful, I use it a lot to solve leetcode problems. If I want to solve daily problem, I need to open leetcode.com on my browser and click the button to open daily problem. And then copy the title and then use this plugin to search it. it's not "ergonomic" enough.

So I modify some codes and support the command 'LBDailyQuestion' which used to open daily problem directly.

Thanks for your CR.

withOutUndo commented 1 year ago

Hello @MSDimos, your only query leetcode.cn, but the query in leetcode.com is different, so you may need to add it. and change the README.

The graphQL of the leetcom.com is as follows:

query questionOfToday {
      activeDailyCodingChallengeQuestion {
        question {
          frontendQuestionId: questionFrontendId
          titleSlug
        }
      }
    }

And the "activeDailyCodingChallengeQuestion" field in response is not an array , and other fields can be left unqueried.