Skip to content

wargatiga2021/shortener

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🔗 URL Shortener for Warga Tiga

This is Warga Tiga's URL shortener based on nelsontky's Github Page shortener.

👨‍🏫 Demo & How To

  1. For example, url.wargati.ga/1 should link to this repo.

  2. To add a new short link:

  • Make sure you have a Github account, if you don't then register. It's easy.
  • Go to https://github.com/farellfaiz/wargatiga-url-shortener/issues.
  • Add an issue by clicking the New Issue button.
  • Fill the issue form with the title being the link you want to shorten (including the http(s)://).
  • Shorten your link by clicking the Submit New Issue button.
  1. The newly created short url can be accessed via url.wargati.ga/{issue_number} Issue number.

☕️ Features

  1. Unlike many URL shorteners, this one does not need a database uses a "database" in the form of GitHub issues and can be entirely hosted on GitHub pages.

  2. There is no need for the pound symbol - short URLs look clean like this: url.wargati.ga/1 instead of looking like this: url.wargati.ga/#1.

💡 How does this work?

Thanks to @kidGodzilla for the pretty neat explanation here.

  1. 404.html handles all requests
  2. Small javascript snippet fetches a JSON representation of the GitHub issue via the JSON API, and redirects to the issue title, as a URL.
  3. Profit?

👨‍💻 Credit