A simple web application (and also a Web API) written in Python.
Find a file
2020-11-11 19:59:15 -03:00
etc update nginx config 2020-11-11 19:59:15 -03:00
static/css remove unused css 2020-11-11 19:58:54 -03:00
templates remove unused css 2020-11-11 19:58:54 -03:00
unalixweb improvements 2020-11-10 00:48:04 -03:00
.gitignore update 2020-11-05 15:18:12 -03:00
LICENSE update 2020-11-05 15:18:12 -03:00
manage.py initial commit 2020-11-02 23:56:06 -03:00
README.md fix more typos 2020-11-05 17:28:54 -03:00

This is a simple web application (and also a Web API) written in Python. It uses this library to allow users to remove tracking fields from URLs and unshort shortened URLs.

Installation

Note: You will need at least Python 3.6 and a Unix-like operating system.

Install all required dependences:

apt-get --assume-yes install \
    'python3' 'python3-pip' 'python3-setuptools' 'python3-wheel' 'git'

Create a separate user:

adduser --shell '/bin/bash' \
    --disabled-login \
    'unalix'

sudo -i --user='unalix'

Clone this repo:

git clone --ipv4 \
    --single-branch \
    --no-tags \
    --depth '1' \
    'https://github.com/AmanoTeam/Unalix-web'

Install all required libraries:

python3 -m pip install --force-reinstall \
    --disable-pip-version-check \
    --no-warn-script-location \
    --user \
    --upgrade \
    'setuptools' 'wheel' 'testresources' 'virtualenv' 'pip'

python3 -m virtualenv --download \
    --no-periodic-update \
    "${HOME}/Unalix-web/venv"

source "${HOME}/Unalix-web/venv/bin/activate"

pip install --force-reinstall \
    --disable-pip-version-check \
    --no-warn-script-location \
    --upgrade \
    'django' 'gunicorn' 'git+https://github.com/AmanoTeam/Unalix'

Start the webserver

cd "${HOME}/Unalix-web"

"${PWD}/venv/bin/gunicorn" \
    --workers '1' \
    --bind '127.0.0.1:35678' \
    'unalixweb.wsgi:application'

Now you have an instance running at http://127.0.0.1:35678/.

API usage

Removing tracking fields:

url='https://deezer.com/track/891177062?utm_source=deezer'

curl --url 'http://127.0.0.1:35678/' \
    --get \
    --data-urlencode "url=${url}" \
    --data-urlencode 'output=json' \
    --data-urlencode 'method=clear'

Unshortening a shortened URL:

url='https://bitly.is/Pricing-Pop-Up'

curl --url 'http://127.0.0.1:35678/' \
    --get \
    --data-urlencode "url=${url}" \
    --data-urlencode 'output=json' \
    --data-urlencode 'method=unshort'

Output from both examples:

{"new_url": "https://deezer.com/track/891177062"}
{"new_url": "https://bitly.com/pages/pricing"}

Note: You can replace http://127.0.0.1:35678/ with the address of any public instance.

Public instances

Don't want to run Unalix locally? Take a look at these public instances:

Third party software

Unalix-web includes some third party software. See them below: