How to Run Scripts from Github
A “source code repository” is a place where code is stored. Developers love to use platforms like Github to ensure they have a remote place to store the code they’re working on.
Side note – If you’re coding, using Photoshop, editing videos, or doing any other work on a computer, back up your files daily and store them online if possible. You never know what might happen and you could end up losing days, weeks, even months of work if you don’t take the necessary steps to back up your files.
Anyways, with Github you can upload private or public repositories. If the repo is public anyone can take that code and use it.
If you’re into sneakers you’ve probably stumbled upon a Github link for some kind of script, whether that’s an Adidas account creator or a proxy tester. These scripts are usually open source and are created with the intention of helping others.
For this guide we will be using a python script created by DefNotAvg. This script is designed to scan supremenewyork.com for products that match the keywords input by the user. If it finds a product match it opens the product link in your browser. Useful, right?
In order to follow these steps successfully these basic requirements must be met.
1. Have Git installed – this link provides tutorials for Mac, Windows, and Linux users.
2. A terminal emulator installed such as Terminal, Command Line, or Hyper.
3. A Github repository to clone and use.
4. Correct version of Python installed (or whatever language the code is written in.)
Once these requirements are met we’re ready to start. The first step to running a script from Github is to clone the git repository.
Clone the git repository
1. Navigate to the main page of the Github repo. For this example we’ll be using this link.
2. Select the green “Clone or download” button.
3. Select the clipboard icon to copy the link to your clipboard.
4. Open a terminal emulator on your desktop. If you’re on Mac the application “Terminal” should be installed by default. Windows users will have “Windows PowerShell” or “Command Prompt”. Another option is Hyper – a sleek cross-platform terminal emulator.
5. Change the directory to the place you’d like the files to be stored. You can do this by entering “cd” in the command line followed by the file path. For this example, we’ll store the files on our desktop by typing “cd desktop”. Click enter to submit the command. If you need further help with this click here.
6. Once you’ve navigated to the desired location type “git clone” , then paste the link you copied in step 2. Once you submit the command you’ll see something like the image below. A folder will appear in the location you specified in step 5.
7. Using the “cd” command you need to navigate to the folder that was just created. In this case that command is “cd Supreme-Link-Grabber”.
Running the script
This part of the guide vastly depends on the script you are trying to run.
If the repo contains a “README.MD” file you should read it and see if the developer included a guide on how to run the script. The Supreme Link Grabber README file states the following.
Ok, great. That’s telling us what the script does, how to run it, what version of Python we need, and what packages are required.
To run a python file type “python filename.py” into the command line then hit enter. The README for our code says that “main.py” should be run, so the command is “python main.py”.
The script will now run.
Issues and errors
You may find yourself frustrated if you’ve never done this before. That’s ok – the GREAT thing about coding is there’s an answer online for every single error. Sites like Stack Overflow allow users to submit code-related questions for others to answer.
Odds are the error you’re receiving isn’t special – someone else has run into the same problem before, and it’s been answered somewhere online. Every issue you’ll run into can be solved with a Google search.
If you have all of the necessary requirements and configuration set up, but you’re still receiving an error message it may be an issue within the code itself. If you’re trying to run a script that hasn’t been updated in 2 years it may simply not work anymore.
Github tracks when the last change was made to each file within the repo so you can get a better idea if the code you’re trying to use is updated or not.
If you enjoyed this guide check out the other articles on our blog. These articles are loaded with practical advice like how to get multiple shoes shipped to the same address, where to get proxies, what servers are, and more.
Subscribe to our newsletter to receive useful content like this straight to your inbox!