Introduction

This application provides a form to *shorten* URLs. It does this buy storing the URL in the database, and providing an alternative URL which looks up the original based on the primary key and automatically forwards. The primary key is encoded in base64 to save on as many characters as possible.

How short the URL becomes depends on your domain and where you mount the application. Assuming you want to add this application to an existing site, you will probably want to mount it on a url such as /s/ to save on characters

You can shorten URLs on demand with the shorten tag in the namespace http://moyaproject.com/shorturl. Here's an example:

<str dst="long_url">https://www.moyaproject.com/blog/post/encrypted-notes-with-moya/</str>
<shorturl:shorten url="long_url" dst="short_url" />

The value of shorturl will now be something along the lines of http://example.org/s/b.

Admin Site

This library will add a module called 'Short URLs' to the admin site. A table called 'Links' will list the original URLs and the number of visits.