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
- Creating Repository in GitHub
- List of useful Github Commands
- Bitbucket vs GitHub vs GitLab
- How to add a README to your GitHub profile?
- How to Upload a Project on Github?
- An Ultimate Guide to Git and Github
- Top 10 Useful GitHub Repos That Every Developer Should Follow
- What is GitHub Student Developer Pack and How to Get it?
- How to Deploy Your React Websites on GitHub?
- 5 GitHub Repositories that Every New Developer Must Follow
- How to Publish a Static Website on GitHub?
- Using Bitbucket as an extension to GitHub capabilities
- How to Upload Project on GitHub from Android Studio?
- Using GitHub to host a free static website
- Making your first Open Source Pull Request | Github
- Fetch top 10 starred repositories of user on GitHub | Python