/gimage

GitHub as an image hosting service

Primary LanguagePython

Gimage - GitHub as an image hosting service

This is a simple Python script as a proof of concept inspired by this post.

Flags

  • -nr - creates new repository
  • --repo - the name of the repo where your images will be uploaded (make the name as short as possible!)
  • --add_token - your public access token

How to run

Before you begin, make sure you have Python 3.x installed.

  1. Install pip.
  2. Clone this repo.
  3. Run pip install -r requirements
  4. Create a GitHub account.
  5. Create a personal access token (PAT) and select public_repo as the access scope.
  6. The first time you run the script, you have to provide the name of your public repo and your PAT. The script can create a repo for you if you add -nr flag. A file will be created storing your PAT and the repo name, so you will not need to provide them later on.

An example of the first time script run:

python .\main.py --add_token xxx_xxx --repo img -nr C:\Users\indrer\image.png

When the settings file is generated, you can simply run the script as:

python .\main.py C:\Users\indrer\image.png

The script then provides you with the link to your image.