Git Product home page Git Product logo

5l1v3r1 / url Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ageis/url

0.0 1.0 0.0 620 KB

URL shortener employing a psuedo-hash involving base62 encoding of a unique integer & prime numbers near the golden ratio. Also features two modes of thumbnail generation plus jQuery autocomplete based on Alexa top sites.

Home Page: https://ageispolis.net/url/

Perl 4.32% PHP 79.48% JavaScript 6.88% CSS 9.31%

url's Introduction

tinyURL 0.1

by @ageis ( kevin [at] ageispolis [dot] net )

URL shortener employing a psuedo-hash involving base62 encoding of a unique integer & prime numbers near the golden ratio. Also features two modes of thumbnail generation plus jQuery autocomplete based on Alexa top sites.

Core requirements:

Installation instructions:

  • Create a MySQL database + user and grant permissions
  • Import the ./includes/lilurl.sql file: mysql -u <user> -p <database> < lilurl.sql
  • Clone this repository from the DocumentRoot, so the files end up in /url
  • Edit ./includes/conf.php to suit your needs, enter the MySQL credentials from earlier
  • Edit .htaccess so that %{HTTP_HOST} matches your domain.
  • If you'd rather set this up on the DocumentRoot, you must set DOCROOT to TRUE, adjust $imgdir and modify .htaccess
  • Make sure mod_rewrite is enabled: a2enmod rewrite
  • You can set a logo for the main page at ./includes/logo.png
  • Enabling LOG requires the PHP PEAR/PDO database abstraction layer and GeoIP database in /usr/share/GeoIP/GeoIPCity.dat (see link above)
  • Enabling THUMBNAIL requires /usr/local/bin/phantomjs by default
  • Thumbnail width can be changed in the configuration file.
  • If you intend to use all the features, these packages should be installed: imagemagick, cutycapt, php5-geoip, php5-mysql, php-db, php5-sqlite, xvfb, phantomjs

You can retrieve just the thumbnail like so: http://example.com/url/index.php?thumb=http://www.google.com

The API will return a shortened URL in plaintext: http://example.com/url/index.php?longurl=http://www.google.com&api=1

If RESTRICTED = true, then you must supply the key with the request: http://example.com/url/index.php?longurl=http://www.google.com&api=1&key=VdZPkSNbMaRZbTZ4

If there is an error or an incorrect key the output will be blank.

The autocomplete suggests https:// because I support the mission to Encrypt the Web / have HTTPS everywhere.

Lists of top sites can be updated with the following logic, ex. 1000: curl -s -O http://s3.amazonaws.com/alexa-static/top-1m.csv.zip ; unzip -q -o top-1m.csv.zip top-1m.csv ; head -1000 top-1m.csv | cut -d, -f2 | cut -d/ -f1 > top1000.txt

Here's my Bitcoin address for donations: 1AgeisUFv9NJ3AGGq7VPJWymGfFpCHDhCw

url's People

Watchers

 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.