Opensooq Gloom : URL Shortener Service

Opensooq Gloom is an opensource service that takes long URLs and squeezes them into fewer characters to make a link that is easier to share, tweet, or email to friends. Users can create these short links through the web interface, or they can programatically create them through the API. With the Gloom you can write applications that use simple HTTP methods to create short links from desktop, mobile, or web.

Admin

Links that users create through the Gloom can also open directly in your mobile applications that can handle those links. This automatic behavior provides the best possible experience to your app users who open your domain links, no matter what platform or device they are on.

This project running by Python with MongoDB as a backend and done using BottlePy and uPyApp

Shorten a long URL

Gloom API allows you to shorten URLs just as you would on your domain. For example, to shorten the URL http://www.google.com/, send the following request:

POST https://YourDomain/shorten
Content-Type: application/json

{"longUrl": "http://www.google.com/"}

For instance, you could issue the following curl command:

curl https://YourDomain/shorten \
  -H 'Content-Type: application/json' \
  -d '{"longUrl": "http://www.google.com/"}'

If successful, the response will look like:

{ 
  "shorten": "XXX",
  "link" : "XXXXXXX"
}

Installation

  1. You need a domian to use it for shorting URL
  2. Install MongoDB
  3. You need pymongo3
virtualenv --system-site-packages virtualenv
source virtualenv/bin/activate
pip install bottle

Configuration

cp example/{uwsgi.ini,app.ini} ./

Then edit those two files. For dev env use

cp example/uwsgi-dev.ini ./uwsgi.ini

Setup Database

./cli migrate