GithubGist is a place where you can create a private or a public gist i.e store your files either privately or publicly. Let us assume a scenario where you have written a good number of gists for your project and you want to download a set of them. The only way you can do it using GithubGist is to open each and every individual gist to download ZIP or clone via HTTP or SSH.
This article is all about making the above task simpler. Using the commands below, you can even download gists from other github users excluding the private ones until you know their password.
We will be using requests package for this propose. It is an awesome package to send HTTP requests with minimal code.
1. Download the package from PyPI via terminal using pip3
pip3 install requests
Note: To become a root user, run the following command:
sudo pip3 install requests
The script can not run on an online IDE and therefore you can click here to see how it works.
GithubGist API stores information about each user at http://api.github.com/users/username/gists.
- Send a HTTP request to the above url to retrieve information about the user.
- Search for the raw_url of every available gist and sent HTTP requests to retrieve the information about them.
- Manipulated the information to your needs.
This article is contributed by Sri Sanketh Uppalapati. If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above.
- Downloading files from web using Python
- Is downloading YouTube videos legal?
- How to speed up the downloading of packages using apt-fast in Ubuntu?
- GIT | An Introduction to Github
- Bitbucket vs GitHub vs GitLab
- An Ultimate Guide to Git and Github
- Creating Repository in GitHub
- List of useful Github Commands
- 5 GitHub Repositories that Every New Developer Must Follow
- Using Bitbucket as an extension to GitHub capabilities
- Using GitHub to host a free static website
- Fetch top 10 starred repositories of user on GitHub | Python
- Making your first Open Source Pull Request | Github
- MPI - Distributed Computing made easy
- Maximum elements that can be made equal with k updates