A demo of how github can be made into a url shortener
Made for CMU GPI
- Fork this repo
- Clone your forked repo.
git clone [email protected]:[your github username]/gpi-url-shortener.git
- Rename the
example_github_config.py
togithub_config.py
and add your github username or custom github url in the file. - Make sure that you have ssh keys setup for your github. If you are not sure how to do this, you can follow this tutorial.
- Add to your
.bashrc
,.bash_profle
,.zshrc
, etc. the following:
alias shorten_url="python3 /absolute/path/to/gpi-url-shortener/url_shortener.py"
Don't forget to re-source
your rc
file!!
- In the repository settings turn on ghpages from the master branch
- You're all set!! Simply from terminal run:
shorten_url
And you should be walked through the process of shortening a url.
You should see something like this:
what url do you want to shorten?
url to be shortened: http(s)://thebomb.com.net.gov
shorten to https://[your github id].github.io/gpi-url-shortener/this_is_super_short
doing some stuff....
url has been shortened to: https://[your github id].github.io/gpi-url-shortener/this_is_super_short/
it might take ~5 mins for the link to become active
- If you have a custom domain you want to use with your url shortener, you can set it up for the github repo by following the instructions here.
Have fun and let us know if you have any questions on piazza!!!
Don't forget to hit the quan and yell YEAAAAAHHHH DONNER 👌 👌 👌 👌