Also check Codewars Activity Chart!
This program allows you to connect to Codewars by using your Codewars credentials and extract all the code of each programming language of every kata you have completed into a folder.
It's discouraged to put your Codewars solutions publicly available because, even though it depends on every person, this may increase the number of dishonest users that copy and paste the solutions to their own advantage. An user can get sanctioned if the Codewars' staff notice an unusual behaviour. Read the Codewars Code of Conduct for more information (especially the last rule).
Although it's not prohibited, please: don't put your Codewars solutions publicly available on GitHub.
A key skill every programmer should have is problem solving (algorithms, paradigms, data structures, etc.), and Codewars is a very good platform to practice this hability because of its structure: support of multiple programming languages, user rank system, easily (with moderation) code challenge creation system and social interaction between users (similar code-challenges, comments, votes, and more).
By having a folder that contains all the code challenges you have completed, you can keep a personal registry of all your katas in a more readable way. Moreover, you can send the folder to a recruiter so they can see what you've done, get to know your strenghts and weaknesses, and see what are the programming languages you use with ease. You could do all of this manually, but going through all the pages of solutions of all the katas you've completed (plus more than one programming language, depending on the case) would take you a lot of time, and you'd have to update it every time you complete a new kata.
This program allows you to automatically copy into a folder the code of the completed challanges you've done: you just have to run the program and let it do its job. The files and directories are stored in such a way that it's easy to navigate through them.
To use this program you need:
- .NET runtime installed on your computer.
- Firefox web browser installed on your computer.
- Geckodriver file from Mozilla.
Important thing to note: If you registered into Codewars using the GitHub OAuth option, you must create a Codewars password. You can do this easily by clicking on the text "Forgot your password?" in the Codewars sign in page.
These are the steps that you must follow to run the program:
- Download the program folder depending on the OS you use (head to the "Releases" tab).
- Download the .NET runtime from the official Microsoft website (currently, the program is targeted to the version 8.0).
- Download the Mozilla geckodriver from the "Releases" tab in Mozilla's repository.
- Check the "config.txt" file to see if the Firefox binary location is actually in that directory
(change it if it's not the case; write it just after
DIRECTORY=
). - With the "geckodriver.exe" file in the program's directory, run the executable.
- Follow the instructions prompted. If you're running it for the first time, choose "n", as there is not any last kata saved yet.
You can also clone the repository to have the code in you local machine and run the program from there.
This way it's faster for you to customise whatever you want. For this, use
git clone https://github.com/JoseDeFreitas/CodewarsLogger.git
.
You need to have .NET and Firefox installed. If you do, go to the
"CodewarsLogger" folder (where the "Program.cs" lies) and type dotnet run
in the console.
And that's it! Keep in mind that it will take time depending on how many katas you've completed, since it must loop through all of them. When the 429 HTTP error ("Too Many Requests") gets thrown, the program automatically stops the execution and waits 2 minutes before continuing with the loop; this happens after approximately 250 API calls.
The program let's you choose whether to run it through all of the katas or just until the last saved one.
Every time you run the program, the slug of the last completed kata is saved in the "config.txt" file
next to the LAST_KATA=
text. Choosing to run the program until encountering this kata is useful if
you know you haven't trained any previous kata and just want to update the folder by adding the new
katas you have completed, massively decreasing the time of execution. If you refactored the code of a
kata you completed in the past, you would have to not choose that option and let it loop through all of
the katas to copy the new code and replace it. I haven't found a better solution for this issue.
For some reason, the API endpoint of Codewars that lists the "completed" katas includes also katas that you have trained but that aren't literally "completed"; that is, katas that have some solution that didn't pass all the tests. You complete a kata when you click the blue button "Attempt" and then the green button "Submit". If you get a list of exceptions (katas which code couldn't be found) is because of this, since Codewars shows a text saying "No solutions" instead of the list of solutions that the program looks for.
For a clearer view of how the program goes through all the katas, you can comment out the line 120
(options.AddArgument("--headless");
) by adding //
before it.
If you're facing a problem, go to the "Errors" page of the wiki and look if the error/warning you're getting appears in there. If it doesn't, please open an issue.
This repository is under the BSD-2-Clause License to follow Codewars's Terms of Service (that were last updated on April, 2022).
If you've read above sections, you know you can customise the program to make it work as you want. Keep in mind that I offer the program as you see it in this repository. Any changes you made are up to you, and I'm not responsible for them. Be careful on what you change. For more related information, please read the "Privacy" page of the wiki. I encourage you to read the whole wiki, too. Don't forget to read the rules from Codewars.