Downloading All Public GitHub Gist Files
- By : Mydatahack
- Category : Data Engineering, Data Ingestion
- Tags: API Data Ingestion, GitHub Gist, Python
I used to use plug-ins to render code blocks for this blog. Yesterday, I decided to move all the code into GitHub Gist and inject them from there. Using a WordPress plugin to render code blocks can be problematic when update happens. Plugins might not be up to date. It can break the site as most of the plugins are server-site rendering. That is exactly what happened to me with WordPress 5.2 update.
Now I am in the process of moving all the code examples to GitHub Gist. In this way, I don’t need to worry about plugins and give greater accessibility to those snippets.
To download all the files from Git Gist, you need to write a small code. This cannot be done from UI. Luckily, GitHub Gist version 3 API is pretty nice. This task can be done easily.
Here is the example of Python code that downloads all my GitHub Gist files. I’m happy for you to use or modify any code snippets for your own projects. You can also use it for your own gists by changing the username.
Yay!