A simple URL shortener built with Flask

Overview

URL Shortener

Latest Release Build Status Coverage Status License

A simple URL shortener built with Flask and MongoDB. A deployed version can be viewed here.

Screenshot

Screenshot

Getting Started

With Docker

Prerequisites

Running

From your terminal/command prompt run:

docker-compose up

Then point your browser to http://127.0.0.1:5000/.

Without Docker

Installing Requirements

  1. (Optional) Install virtualenv and virtualenvwrapper and create a new environment.
  2. Run pip install -r requirements.txt.

Setting up MongoDB

You can either:

  • Install MongoDB locally by going here.

or:

Configuration

The following properties can be configured:

Name Purpose Default
DEBUG If debug mode is enabled. False
ENV Environment the app is running in. production
MONGODB_HOST The MongoDB host name. 127.0.0.1
SECRET_KEY A secret key used for security. default secret key
SERVER_NAME The host and port of the server. 127.0.0.1:5000
SESSION_COOKIE_DOMAIN The domain match rule that the session cookie will be valid for. 127.0.0.1:5000
SSL If the domain has a valid SSL certificate. True

To change these properties you can export them as environment variables or create a file instance/config.py (note that any environment variables take precedence).

URI style connections are also supported for connecting to MongoDB, just supply the URI as MONGODB_HOST (note that URI properties will take precedence).

Running

From your terminal/command prompt run:

./run.py

Then point your browser to http://127.0.0.1:5000/.

Technology Used

For those of you that are interested, the technology used in this project includes:

License

This project is licensed under the MIT License - see the LICENSE file for details.

You might also like...
๐ŸŒ URL parsing and manipulation made easy.

furl is a small Python library that makes parsing and manipulating URLs easy. Python's standard urllib and urlparse modules provide a number of URL re

Have you ever wondered: Where does this link go? The REDLI Tool follows the path of the URL.
Have you ever wondered: Where does this link go? The REDLI Tool follows the path of the URL.

Have you ever wondered: Where does this link go? The REDLI Tool follows the path of the URL. It allows you to see the complete path a redirected URL goes through. It will show you the full redirection path of URLs, shortened links, or tiny URLs.

A URL builder for genius :D

genius-url A URL builder for genius :D Usage from gurl import genius_url

declutters url lists for crawling/pentesting
declutters url lists for crawling/pentesting

uro Using a URL list for security testing can be painful as there are a lot of URLs that have uninteresting/duplicate content; uro aims to solve that.

find all the URL of a site with a specific Regex
find all the URL of a site with a specific Regex

href this program will find all the link with a spesfic Regex pattern from a site. what it will do in any site there are a lots of url that may you ne

This is a no-bullshit file hosting and URL shortening service that also runs 0x0.st. Use with uWSGI.

This is a no-bullshit file hosting and URL shortening service that also runs 0x0.st. Use with uWSGI.

A python code for url redirect check

A python code for url redirect check

A url redirect status check module for python

A url redirect status check module for python

Use this module to detect if a URL is on discord's phishing list.

PhishDetector This module was made so you can check a URL and see if it's in discord's official list of phishing and suspicious URLs. Installation pip

Releases(v1.6.2)
  • v1.6.2(Aug 25, 2019)

  • v1.6.1(Apr 24, 2019)

  • v1.6.0(Apr 23, 2019)

  • v1.5.1(Apr 21, 2019)

    Bug Fix

    If a user created a new link, clicked copy and immediately changed the link text, then a weird behaviour involving clipboard timeouts would occur. To fix this, we now clear the clipboard timeouts when input changes.

    Source code(tar.gz)
    Source code(zip)
  • v1.5.0(Apr 21, 2019)

  • v1.4.0(Apr 21, 2019)

    New Features

    • Added 500 error page.
    • Added GitHub banner.
    • Added page footer.
    • Allow user to copy links to clipboard.
    • Reject already shortened links.

    screenshot-2

    Source code(tar.gz)
    Source code(zip)
  • v1.3.0(Apr 20, 2019)

  • v1.2.1(Apr 6, 2019)

    Bug Fix

    If /new/ was part of the URL to be shortened, then everything after and including the /new/ segment in the URL would be ignored. For example, http://google.co.uk/new/path-to-something-else/ was being stored as http://google.co.uk in the database. This has now been fixed so the full URL is stored in the database.

    Source code(tar.gz)
    Source code(zip)
  • v1.2.0(Mar 18, 2019)

  • v1.1.1(Nov 23, 2018)

    Bug Fix

    Query parameters in URLs were being ignored. For example, https://www.youtube.com/watch?v=FyYMzEplnfU was being stored as https://www.youtube.com/watch in the database. This has now been fixed so the full URL is stored in the database.

    Source code(tar.gz)
    Source code(zip)
  • v1.1.0(Nov 22, 2018)

    New Features

    • Sequences are now hex encoded which will mean shorter links as more are added.
    • Requests are not sent for links that are already in the cache.
    • Links that are already in the cache and requested to be shortened again are now moved to the top of the Your Links list.
    Source code(tar.gz)
    Source code(zip)
  • v1.0.0(Nov 21, 2018)

Owner
Mike Lowe
like a sucked and spat-out smartie
Mike Lowe
๐ŸŒ URL parsing and manipulation made easy.

furl is a small Python library that makes parsing and manipulating URLs easy. Python's standard urllib and urlparse modules provide a number of URL re

Ansgar Grunseid 2.4k Jan 04, 2023
declutters url lists for crawling/pentesting

uro Using a URL list for security testing can be painful as there are a lot of URLs that have uninteresting/duplicate content; uro aims to solve that.

Somdev Sangwan 677 Jan 07, 2023
Customizable URL shortener written in Python3 for sniffing and spoofing

Customizable URL shortener written in Python3 for sniffing and spoofing

3 Nov 22, 2022
A python code for url redirect check

A python code for url redirect check

Fayas Noushad 1 Oct 24, 2021
A simple URL shortener built with Flask

A simple URL shortener built with Flask and MongoDB.

Mike Lowe 2 Feb 05, 2022
Simple Version of ouo.io. shorten any link on the web easily

OUO.IO LINK SHORTENER This is a simple python script that made to short links. currently ouo.io doesn't have Application Programming Interface so i de

Danushka-Madushan 1 Dec 11, 2021
coURLan: Clean, filter, normalize, and sample URLs

coURLan: Clean, filter, normalize, and sample URLs Why coURLan? โ€œGiven that the bandwidth for conducting crawls is neither infinite nor free, it is be

Adrien Barbaresi 20 Dec 14, 2022
This is a no-bullshit file hosting and URL shortening service that also runs 0x0.st. Use with uWSGI.

This is a no-bullshit file hosting and URL shortening service that also runs 0x0.st. Use with uWSGI.

mia 1.6k Dec 31, 2022
Use this module to detect if a URL is on discord's phishing list.

PhishDetector This module was made so you can check a URL and see if it's in discord's official list of phishing and suspicious URLs. Installation pip

Elijah 4 Mar 25, 2022
Yet another URL library

Yet another URL library

aio-libs 884 Jan 03, 2023
Fast pattern fetcher, Takes a URLs list and outputs the URLs which contains the parameters according to the specified pattern.

Fast Pattern Fetcher (fpf) Coded with 3 by HS Devansh Raghav Fast Pattern Fetcher, Takes a URLs list and outputs the URLs which contains the paramete

whoami security 5 Feb 20, 2022
UDdup - URLs Deduplication Tool

UDdup - URLs Deduplication Tool The tool gets a list of URLs, and removes "duplicate" pages in the sense of URL patterns that are probably repetitive

Rotem Reiss 128 Dec 21, 2022
find all the URL of a site with a specific Regex

href this program will find all the link with a spesfic Regex pattern from a site. what it will do in any site there are a lots of url that may you ne

Arya Shabane 12 Dec 05, 2022
encurtador de links feito com python

curt-link encurtador de links feito com python! instalaรงรฃo Linux: $ git clone https://github.com/bydeathlxncer/curt-link $ cd curt-link $ python3 url.

bydeathlxncer 5 Dec 29, 2021
Astra is a tool to find URLs and secrets.

Astra finds urls, endpoints, aws buckets, api keys, tokens, etc from a given url/s. It combines the paths and endpoints with the given domain and give

Stinger 198 Dec 27, 2022
A simple, immutable URL class with a clean API for interrogation and manipulation.

purl - A simple Python URL class A simple, immutable URL class with a clean API for interrogation and manipulation. Supports Pythons 2.7, 3.3, 3.4, 3.

David Winterbottom 286 Jan 02, 2023
Simple python library to deal with URI Templates.

uritemplate Documentation -- GitHub -- Travis-CI Simple python library to deal with URI Templates. The API looks like from uritemplate import URITempl

Hyper 210 Dec 19, 2022
A friendly library for parsing HTTP request arguments, with built-in support for popular web frameworks, including Flask, Django, Bottle, Tornado, Pyramid, webapp2, Falcon, and aiohttp.

webargs Homepage: https://webargs.readthedocs.io/ webargs is a Python library for parsing and validating HTTP request objects, with built-in support f

marshmallow-code 1.3k Jan 01, 2023
C++ library for urlencode.

liburlencode C library for urlencode.

Khaidi Chu 6 Oct 31, 2022
A teeny Tiny module to check URLs against discord's list of phishing domains

A teeny Tiny module to check URLs against discord's list of phishing domains

kaj 1 Aug 29, 2022