GithubHelp home page GithubHelp logo

wdbm / ovipositor Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 1.13 MB

Flask link shortening service

License: GNU General Public License v3.0

Python 68.73% Awk 22.88% HTML 8.39%
yourls database database-sqlite yourls-database flask

ovipositor's Introduction

ovipositor

Flask link-shortening service and database system

credits

  • name by Ellis Kay

introduction

Ovipositor is a link-shortener web program. A long URL is entered, together with an optional shortlink and an optional comment. When creating a shortlink, the long URL and the shortlink are saved to a database. When an attempt is made to use a shortlink, the specified shortlink is searched for in the database and, if the shortlink is in the database, there is a redirect to its corresponding long URL.

setup

sudo apt install sqlite
sudo pip install ovipositor

Flask

while true; do
    ovipositor --home="index.html"
done

Gunicorn

sudo gunicorn --workers=1 "ovipositor.__init__:WSGI(argv=['--home=index.html'])" --bind=0.0.0.0:443 --certfile=/home/user/certificates/fullchain.pem --keyfile=/home/user/certificates/privkey.pem

ovipositor database structure

There is one table in an ovipositor database called "shortlinks". This table has 6 fields:

field description
comment shortlink descriptive comment
count shortlink usage count
IP IP address that created the shortlink
URL long URL to which the shortlink corresponds
shortlink shortlink text
timestamp shortlink creation timestamp

changing from YOURLS to ovipositor

An export dump should be made of the YOURLS MySQL database and the dump should be converted to an SQLite3 database. This can be done using mysql2sqlite.

The YOURLS SQLite database then can be converted to an ovipositor database using the script convert_YOURLS_SQLite_database_to_ovipositor_database.py.

convert_YOURLS_SQLite_database_to_ovipositor_database.py --help

convert_YOURLS_SQLite_database_to_ovipositor_database.py \
    --database_YOURLD=linkdb.db                          \
    --database_ovipositor=ovipositor.db

The YOURLS database contains three tables, "yourls_url", "sqlite_sequence" and "yourls_options". These tables have the following fields:

  • yourls_url
    • clicks
    • ip
    • keyword
    • timestamp
    • title
    • url
  • sqlite_sequence
    • name
    • seq
  • yourls_options
    • option_id
    • option_name
    • option_value

In changing from YOURLS to ovipositor, the following database table and field conversions are made:

YOURLS ovipositor
yourls_url shortlinks
clicks count
ip IP
keyword shortlink
url URL
timestamp (datetime.datetime) timestamp (datetime.datetime)
title comment

ovipositor's People

Contributors

wdbm avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.