Skip to main content
# tinyurls

URL shortening service to be used in a microservices environment.

This service does the following:
1. Takes a long url and stores an md5 key and the url in a database table.
The md5 key is used to lookup the long url. This step returns a short link
with md5.
2. Takes a short link and redirects you to the long link.





## Installation
Clone code
```bash
git clone git@github.com:rangertaha/tinyurls.git
```
Use virtual environment
```bash
virtualenv env
source env/bin/activate

```
Change into tinyurls directory and install
```
cd tinyurls
python setup.py install

or

pip install tinyurls

```

## Execute
```bash
tinyurls -h
usage: tinyurls [-h] [-p PORT] [-d DATABASE]

optional arguments:
-h, --help show this help message and exit
-p PORT, --port PORT Port used for this service
-d DATABASE, --database DATABASE Database to use


tinyurls -p 9999

```

In a new terminal post the link to shorten
```bash
curl -X POST -H "Content-Type: text/plain" --data "https://www.google.com/search?q=tornado+logging+to+ELK&rlz=1C5CHFA_enUS752US752&oq=tornado+logging+to+ELK&aqs=chrome..69i57.9210j1j4&sourceid=chrome&ie=UTF-8" http://127.0.0.1:9999
http://127.0.0.1:9999/284380fea5eaf2464e06a3873647d324
```

In the browser go to `http://127.0.0.1:9999/284380fea5eaf2464e06a3873647d324`



Metadata

Release files for tinyurls 0.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for tinyurls 0.0.3
File Interpreter ABI Platform
tinyurls-0.0.3-py3-none-any.whl Python 3 none any Details

Release files / tinyurls-0.0.3-py3-none-any.whl

Download URL tinyurls-0.0.3-py3-none-any.whl
Size 5.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
30bbf2e9d43222bfb6559b3e5bc93c6f6d9bb11e3f7d200fcf1a937d3841c7fe
BLAKE2b-256 checksum
How to use checksums
7a4e4700df096214e107df02dfc63887c620032e860e8a4a26795f391c1b1250
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.6.4

Release history Release notifications | RSS feed

This release

0.0.3 This release

1 release file

0.0.2

3 release files

0.0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page