Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/josedefreitas/codewarslogger

Automatically pull all your completed code-challenges from Codewars into a folder to keep track of your solutions in a logically-organised index.
https://github.com/josedefreitas/codewarslogger

automation codewars webdriver webscraping

Last synced: about 2 months ago
JSON representation

Automatically pull all your completed code-challenges from Codewars into a folder to keep track of your solutions in a logically-organised index.

Awesome Lists containing this project

README

        

# CodewarsLogger

![GitHub all releases](https://img.shields.io/github/downloads/JoseDeFreitas/CodewarsLogger/total)
![Supported OS versions](https://img.shields.io/badge/for-Windows%2C%20MacOS%2C%20Linux-blue)
![Architecture of 64 bits](https://img.shields.io/badge/architecture-64--bit-purple)

> Also check [Codewars Activity Chart](https://github.com/JoseDeFreitas/codewars-activity-chart)!

This program allows you to connect to [Codewars](https://www.codewars.com) 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](https://docs.codewars.com/community/rules/)
for more information (especially the last rule).

**Although it's not prohibited, please: don't put your Codewars solutions publicly available on GitHub.**

## Screenshots

README file (index)

Folders of the katas

Inside a kata folder

Solution of a kata

## Why?

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. Moreover, the files and directories are
stored in such a way that it's easy to navigate through them.

## Usage

### Requirements

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](https://www.codewars.com/users/sign_in).

### Execution

These are the steps that you must follow to run the program:
1. Download the program folder depending on the OS you use (head to the ["Releases" tab](https://github.com/JoseDeFreitas/CodewarsLogger/releases)).
2. Download the [.NET runtime](https://dotnet.microsoft.com/en-us/download) from the official Microsoft website
(currently, the program is targeted to the version 8.0).
3. Download the [Mozilla geckodriver](https://github.com/mozilla/geckodriver/releases) from the "Releases" tab in Mozilla's repository.
4. Check the "firefox_directory.txt" file to see if the Firefox binary location is actually in that directory
(change it if it's not the case).
5. With the "geckodriver.exe" file in the program's directory, run the executable.
6. Follow the instructions prompted.

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](https://dotnet.microsoft.com/en-us/download) and Firefox installed. If you do, go to the
"CodewarsLogger" folder (where the "Program.cs" lies) and type `dotnet run` in the console.

### After completion

And that's it! Keep in mind that it will take some minutes the first time you run it because the program
must loop through all of the katas. You must run the program every time you want to update the katas.
It takes into consideration repeated files and code refactors.

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". This may lead to some warnings on the console that say `A web element was not found on the page
(create code file step).`, because 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 102](https://github.com/JoseDeFreitas/CodewarsLogger/blob/89830706167212643a03de70df8ed3aae22bc008/CodewarsLogger/Program.cs#L102)**
(`options.AddArgument("--headless");`) by adding `//` before it.

If you're facing a problem, go to the ["Errors" page](https://github.com/JoseDeFreitas/CodewarsLogger/wiki/Errors)
of the wiki and look if the error/warning you're getting appears in there. If it doesn't, please
[open an issue](https://github.com/JoseDeFreitas/CodewarsLogger/issues/new?assignees=&labels=bug&template=bug_report.yaml).

## Disclaimer

This repository is under the [BSD-2-Clause License](LICENSE) to follow
[Codewars's Terms of Service](https://www.codewars.com/about/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](https://github.com/JoseDeFreitas/CodewarsLogger/wiki/Privacy) of the wiki. I
encourage you to read the whole wiki, too. **Don't forget to read the rules from Codewars.**