We start by polr, the most recent URL shortener: work at polr started in 2013. Besides a convenient installer and a public shortener interface, polr supports user accounts along with a fully responsive design based on Bootstrap. The newest (unstable) 2.0.0xx pre-releases also include an API and aim at rate limiting. On the downside, the coding style of the current stable version 1.5.1 is not as skilled as that of YOURLS or tr.im, and the access statistics are simple visitor counters, without any graphical illustration of e.g. the geo-location of the visitors. Access stats in polr are always public, i.e. never private to the creator of a link, and there is no plugin architecture.
Like tr.im and YOURLS, polr supports custom short URLs, which become available after the “Link options” button has been clicked. Another nice extra is the support of secret short URLs: once toggled to “Secret”, polr creates short URLs like e.g.
http://polr.me/z3p?Trtl with a secret password
Trtl for accessing
http://polr.me/z3p. This is very similar to a feature of tr.im that we had already seen (however, tr.im allows to choose your own password, whereas polr generates a random one).
After shortening, a custom or incremental short URL is created (polr currently does not allow for random URLs):
As has been mentioned before, polr stats are simple and they are always publicly accessible:
If you are on version 1.5.1 of polr, the user panel looks like this:
The (unstable) pre-releases of polr 2.0.0xx however show a new tab in the user panel called “Developer”:
Clicking the developer tag reveals new options for an API, including an API key and an API rate limit:
URL Shortener by DT Netsolution
Next, after this outlook for the future of polr, we take a short look at a neat piece of open source software aptly named “URL Shortener“. It was written by the German company DT Netsolution GmbH, and is offered only in German language. It features custom short URLs or random short URLs like e.g.
http://urlshorten.er?28368 (and no, there is no such top level domain as .er, this is just an example). In contrast to all previously discussed shortener solutions, URL shortener assumes that only the admin can create user accounts. In this respect a truly public interface is not supported. URL shortener is a small and nice solution whenever a closed user group needs to shorten links for their daily work, e.g. think of the staff of a library.
Additional features are:
- responsive design based on Bootstrap
- integrated user role model (admin vs. normal users)
- automated link expiry
- protecting links against deletion
The last item in our brief review of open source solutions for URL shorteners and pastebins is kissa.be. Kissa.be was pretty popular when it was published in 2008, but unfortunately development has already been canceled. It provides a very nice public interface with multiple options including, but not limited to the shortening of URLs (we will look into this in more detail later). It was written in PHP and smarty, and so a bunch of templates are ready to be edited, facilitating any desired adaption of the design. On the other hand, kissa.be does neither ship with a responsive design, nor does it support user accounts or private statistics (and stats are simple visitor counts anyway). Nonetheless, the nifty, multi-functional public interface (see below) was probably a good reason why kissa.be had once gained much interest.
As illustrated above, the kissa.be interface allows for the shortening of URLs, emails, text, and images. We start by shortening an URL. Next, you see the info page of the shortened URL. It can be accessed by appending a “
-” sign to the short URL, e.g. like so:
Kissa.be also displays access statistics (as a simple visitor counter) to the right of the toolbar. However, there is no user management and so stats are always publicly accessible. Since we believe in private stats, the counter has been removed in our demo.
And now: how about shortening an e-mail? This may first sound absurd as an e-mail is usually not very long. But in fact “leaving your email as plain text in forums, on Twitter or on classified sites makes you an easy spam target”, and the idea of scr.im is to protect e-mail addresses against this—for a more detailed explanation see here. On a side note, scr.im is based on YOURLS (not kissa.be), and was built by the author of YOURLS.
The created short URL redirects your browser to the canonical URI for the targeted e-mail address, e.g. to
mailto:firstname.lastname@example.org. Provided that you have a default e-mail reader installed, this should fire it up:
Notice that more would need to be done to mimic the behavior of scr.im: to keep bots from scanning your e-mail address, a visitor should pass a captcha test before access to the e-mail URI can be granted. But that should be easy enough to add.
Kissa.be also allows shortening text. Here, we will be shortening lines 1–5 of a well-known poem of Samuel Taylor Coleridge:
On visit of the created short URL, the kissa.be software lets your browser display the text (here, shown as the respective info page with toolbar, invoked by appending a “-” to the short URL again):
Last but not least, kissa.be can also be used to shorten images! The images will be hosted on your webserver, and users can upload them either by giving the URL of an image on the web, or by uploading it from the local hard disk of their computer. In the following, we will simply use an image already on the web:
Not surprisingly, kissa.be displays the image when visiting the created short URL (or, like below, its info page):
This ends our little tour through the various self-hosted solutions for URL shorteners and pastebins.