{"id":26984575,"url":"https://github.com/denisovichdev/codingtrain-contribution-util","last_synced_at":"2025-04-03T17:48:31.222Z","repository":{"id":57845376,"uuid":"528469015","full_name":"DenisovichDev/codingtrain-contribution-util","owner":"DenisovichDev","description":"A python script to make codingtrain coding challenges porting easier","archived":false,"fork":false,"pushed_at":"2022-10-18T15:52:48.000Z","size":17,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2023-09-05T05:16:44.593Z","etag":null,"topics":["thecodingtrain"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DenisovichDev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-08-24T14:50:25.000Z","updated_at":"2023-09-05T05:16:44.595Z","dependencies_parsed_at":"2023-01-20T08:15:56.044Z","dependency_job_id":null,"html_url":"https://github.com/DenisovichDev/codingtrain-contribution-util","commit_stats":null,"previous_names":[],"tags_count":0,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DenisovichDev%2Fcodingtrain-contribution-util","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DenisovichDev%2Fcodingtrain-contribution-util/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DenisovichDev%2Fcodingtrain-contribution-util/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DenisovichDev%2Fcodingtrain-contribution-util/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DenisovichDev","download_url":"https://codeload.github.com/DenisovichDev/codingtrain-contribution-util/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247052498,"owners_count":20875681,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["thecodingtrain"],"created_at":"2025-04-03T17:48:30.662Z","updated_at":"2025-04-03T17:48:31.203Z","avatar_url":"https://github.com/DenisovichDev.png","language":"Python","readme":"# Coding Train Contribution Porting Utility\n\nThis project was created to make the process of porting the contributions from the old\nCoding Train Website to the new one a bit easier for the contributors. This python script\ntakes the old contribution metadata in markdown format as an input and creates individual\njson files containing the metadata of each individual contributions (following the new\nGatsby format) that can now be copied into the `showcase` folder.\n\n**Warning**: I am not a python programmer, there must be ways to do this better. In that case please let me know.\n\n## How To Use\n\nFirst clone this repo locally in your computer.\n\nOpen the video metadata file from the [old website archive](https://github.com/CodingTrain/website-archive). These files could be found in the repo inside folders like `_CodingChallnges` or `_GuestTutorials` and so on, with an underscore at the beginning. Open the correct metadata file and copy only the contributions part to a `txt` file inside the directory of this script. For example:\n```txt\n  - title: \"Asteroid Field\"\n    author:\n      name: \"Bossy Smaxx\"\n      url: https://asteroidfield.glitch.me\n    url: https://glitch.com/~asteroidfield\n  - title: \"Swifty Starfield\"\n    author:\n      name: \"Bob Voorneveld\"\n      url: \"https://www.bobvoorneveld.nl\"\n    url: \"https://github.com/bobvoorneveld/Coding-Challenges/tree/master/CC001-Starfield\"\n  - title: \"Hyperdrive Engaged\"\n    author:\n      name: \"JurriaanD\"\n      url: \"http://projects.jurriaan.be/starfield/\"\n    url: \"https://github.com/JurriaanD/Starfield\"\n  - title: \"ES6 Starfield\"\n    author: \"Bjorn Van Acker\"\n    url: https://bjorvack.github.io/code-challenges/challenges/cc-001-starfield/\n    source: https://github.com/bjorvack/code-challenges/tree/master/challenges/cc-001-starfield\n```\nRemember to be careful about not skipping any spaces in the beginning. This file should be the exact copy of the contributions metadata. \n\nNow run the command:\n```bash\npython3 main.py your_input_file.txt\n```\n\nYou can also choose not to mention the input filename in the command line argument. In that case, simply name the text file `contrib.txt` and it will use it as the input by default. The command would be, simply:  \n\n```bash\npython3 main.py\n```\n\nNow you should see the json files appear in the `output` folder. Check them to be sure that the script worked correctly. Now you can copy the contents of the `output` folder to your `showcase` directory. Please note that the `.gitkeep` file is not to be copied into the `showcase` directory.  \n\nTo reuse this script again, make sure to clean the directory:\n```bash\nsudo rm -f output/*.json *.txt\n```\n\nIf you are not using bash or another UNIX command line, you can also just manually delete the JSON and the input files, and you are good to go.\n\n## Comments\n\n- Make sure to always check the outout files before using them.\n- The script converts the `video_id` property to a valid `url` property.\n- The `source` property isn't used as discussed [here](https://github.com/CodingTrain/thecodingtrain.com/issues/244).\n- There is absolutely no exception handling, I'm sorry!\n- I would like to implement a way fetch the metadata directly from the website archive, but I feel like that would be a bit of an overkill\n- This whole project was written entirely in a train, which is very appropriate, I feel.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdenisovichdev%2Fcodingtrain-contribution-util","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdenisovichdev%2Fcodingtrain-contribution-util","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdenisovichdev%2Fcodingtrain-contribution-util/lists"}