GithubHelp home page GithubHelp logo

av-ip's Introduction

#AVIP

Summary

AVIP is a lightweight ruby gem for geolocation of ip addresses. The gem is a wrapper built around ipinfo.io. Everything is native ruby and requires no non-standard ruby gems.

Installation

Fairly standard stuff

gem install av-ip

Usage

To initialize an instance of the geolocation tool, simply call

locater = AVIP.new()

The default instance is localhost, '127.0.0.1', yielding every output parameter. If you are unsure about settings it is best to leave the default parameters.

Post initialization, you may pass the locater paramters in hash format. Example:

locater.update({:content => [:ip, :city, :region], :ip => '127.0.0.1
'})

To recieve the data, simply call

locater.search 
	#=> {:ip => '127.0.0.1', :city => 'timbucktoo', :region => 'basement land'}

By default, search looks for the ip stored in the options, but simply adding any ip parameter to search will work such as

locater.search('123.45.67.89')

The following output parameters are:

:ip,
:hostname,
:city,
:region,
:country,
:loc,
:org,
:postal

##Notes The next phase in development is bulk geolocation and google map construction ##Contribute I Would love for y'all to contribute. Fork and hit me up.

av-ip's People

Contributors

henrywalters avatar

Watchers

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