Do you have many accepted solutions in CodeForces/CodeChef/Atcoder, but you can't share a convenient link to your GitHub to flex your submissions? Maybe it would take too long to upload all the files because you 1000+ accepted submissions?
Introducing UpCode, the program that uploads all your accepted solutions to your GitHub. Just enter your username and a GitHub API key and it will automatically upload all your accepted submissions from CodeForces/CodeChef/Atcoder to a GitHub repository.
For example, here's my repository that was generated by UpCode: https://github.com/crapthecoder/Competitive-Programming
I cannot guarantee that this will work perfectly, as the websites could block the scraper (especially CodeForces). Therefore, a few solutions might get skipped. The code goes through them once at the end to add the missing ones, but it might not be perfect. Also use at your own discretion, as if you make far too many requests somehow, the websites may temporarily block you.
To use UpCode, perform the following steps:
Make sure python is installed, the project will not work otherwise.
Generate a GitHub API key from here. Make sure the repo section is checked.
Download the project from GitHub and extract it.
Navigate to the
UpCode-masterfolder, replace the path with
cmd, and press enter.
pip install -r requirements.txt
python3 main.py. If it doesn't work, try
Enter credentials as prompted
If all goes well, then you should see some lines like
CodeForces/GNU C++20 (64)/1234E | Hello World/123456789.cpp CREATED. After that, you should be able to see the updates in your GitHub repository.
If you are running the CodeForces scraper, a Chrome browser will open. DO NOT close it or interact with it. You can safely ignore it and do something else.
DO NOT run multiple instances of the program for the same repository. Also, do not turn off or sleep the PC when the code is executing.
It is recommended to not run the code during a CodeForces contest, as a popup notification could possibly stop the code from scraping properly. Please wait until the contest is over.
If there are some errors, please ignore them as long as the entire program doesn't stop. The code will go through the failed submissions again to make sure they get added.
If the code stops executing, please try downloading the latest update again, as there have been many major updates/bug fixes thanks to the community. If there are still any issues, let me know in the comments and I will make sure to help you out!
CodeForces API is sometimes inconsistent and might not always be available, in which case you will be notified by the program. In that case, please wait for a while and try again.
Due to the Atcoder API only updating every week, there won't be any changes to the Atcoder folder in the repository if you run UpCode multiple times before it updates.
Special thanks to:
- advik123 for being my mentor in this project.
- ghosty for agreeing to test if he was mentioned in the blog. So here you go nerd. (Also for helping me make this blog)
- aryan12 for existing and sharing his wisdom to the world.
- parth_kabra for finding like 20 bugs and testing my project.
- evenvalue for not bullying me (
he bullied me into saying this)
Thank you to everyone for pointing out bugs, or suggesting some new feature. The CodeForces scraper was very hard to create, and still not as efficient as I would like it to be. But it should work, though it might take some time. If there are any bugs, please do let me know, as I want to make sure this project works for everyone :D
Go to this link, follow the instructions, and bam. Your accepted submissions from CodeForces/CodeChef/Atcoder will get uploaded to GitHub.