Coder Social home page Coder Social logo

6api / telize Goto Github PK

View Code? Open in Web Editor NEW

This project forked from fcambus/telize

0.0 1.0 0.0 172 KB

Telize is a JSON IP and GeoIP REST API (IP Geolocation) built on Nginx and Lua

Home Page: http://www.telize.com

License: BSD 3-Clause "New" or "Revised" License

telize's Introduction

                           t  e  l  i  z  e
                       _______________________
                 ______\                     /_______
                \\     \\           ___     //      /
           __    \ ____  \   __    /   \   _____/\ / ____
       ___/  \____/  _//____/  \___\___/___\__   /__/  _//____
      \\__    ____  __/  __     __      ____    ____  __/  __///
        /      \_   |/    \_     /       \/     /_/   |/    \_
      \\\   ___/\___       /____/\_______/\   ___/\___       /
  <0(--- \__/ -h7- \______/   \       .    \__/ ---- \______/ --(0>
                       \      .\     /.      .
                        \      .\   //      /
                         \______\\ //______/ 
                                  Y

Description

Telize is a REST API built on Nginx and Lua allowing to get a visitor IP address and to query location information from any IP address. It outputs JSON-encoded IP geolocation data, and supports both JSON and JSONP.

Requirements

Nginx modules

Telize requires Nginx compiled with the following modules :

If you are using Debian stable, the nginx-extras package have these modules compiled-in.

Lua modules

Telize requires the following Lua module :

  • Lua CJSON

Installing via LuaRocks :

luarocks install lua-cjson

GeoIP databases

Telize requires the free GeoLite databases : http://dev.maxmind.com/geoip/legacy/geolite/

For IPv4 support only :

mkdir -p /usr/share/GeoIP
cd /usr/share/GeoIP
wget http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz
wget http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz
wget http://download.maxmind.com/download/geoip/database/asnum/GeoIPASNum.dat.gz
gunzip *gz

For IPv4 and IPv6 support :

mkdir -p /usr/share/GeoIP
cd /usr/share/GeoIP
wget http://geolite.maxmind.com/download/geoip/database/GeoIPv6.dat.gz
wget http://geolite.maxmind.com/download/geoip/database/GeoLiteCityv6-beta/GeoLiteCityv6.dat.gz
wget http://download.maxmind.com/download/geoip/database/asnum/GeoIPASNumv6.dat.gz
gunzip *gz

Installation

Copy timezone.conf in the Nginx configuration files directory.

Edit nginx.conf to include timezone.conf and to add directives specifying the path to the GeoIP database files, within the http block.

For IPv4 support only :

http {

	...

	include        /etc/nginx/timezone.conf;

	geoip_country  /usr/share/GeoIP/GeoIP.dat;
	geoip_city     /usr/share/GeoIP/GeoLiteCity.dat;
	geoip_org      /usr/share/GeoIP/GeoIPASNum.dat;
}

For IPv4 and IPv6 support (requires at least Nginx 1.3.12) :

http {

	...

	include        /etc/nginx/timezone.conf;

	geoip_country  /usr/share/GeoIP/GeoIPv6.dat;
	geoip_city     /usr/share/GeoIP/GeoLiteCityv6.dat;
	geoip_org      /usr/share/GeoIP/GeoIPASNumv6.dat;
}

Then deploy the API configuration file telize to the appropriate location on your system, and reload Nginx configuration.

Usage

For complete API documentation and JavaScript API usage examples, please check the project site : http://www.telize.com

Get IP address in Plain text format :

Get IP address in JSON format :

Get IP address location in JSON format :

Calling the API endpoint without any parameter will return the visitor IP address :

Appending an IP address as parameter will return location information for this IP address :

License

Telize is released under the BSD 3-Clause license. See LICENSE file for details.

Author

Telize is developed by Frederic Cambus

Resources

Project Homepage : http://www.telize.com

Latest tarball release : http://www.statdns.com/telize/telize-1.01.tar.gz

GitHub : https://github.com/fcambus/telize

telize's People

Contributors

fcambus avatar jnalley avatar

Watchers

James Cloos 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.