A shortener made for hand-typed URLs, from flyers and handouts for human subjects studies. Small, simple, does not require a database — shortened URLs and logs are stored in text files. Requires python 3.7 or higher.
Removes any non-alphanumeric characters from incoming URLs, and changes everything to lower case. Merges URL parameters — see Examples below.
For logging, quickshort stores hit counts both as a single number and individual entries. Hit counts and logs can optionally be given HTTP endpoints.
A demo of this project is available on Glitch.
/foo-bar /Foo_Bar /FOOBAR
will all look for a redirection file called foobar
. If foobar
contains https://example.com?a=b, then:
/foo-bar?a=c&d=e
will redirect to https://example.com?a=b&d=e
- Clone this
pip install -r requirements.txt
export REDIRECTS_PATH=<somewhere you control>
- Optionally export
HITCOUNT_PATH
andLOG_PATH
- If you want to serve hit counts and logs over HTTP, export SERVE_LOGS
- Create a file in
$REDIRECTS_PATH
named with the redirection key you want. Only lowercase letters and numbers are allowed. - In that file, put the target URL
- Start the flask server, it will create
$REDIRECTS_PATH/hits
- Any hits to that server will look in
$REDIRECTS_PATH/<normalized_path>
and redirect to the new destination - In production, do whatever you need to to get it running all nice
- Set the GUNICORN_LOGGING environment variable to use gunicorn's logging settings