Skip to content

defkode/ipinfodb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ipinfodb

Ruby gem for IP address geolocation via API calls to IPInfoDB.com.

Installation

gem install ipinfodb

Usage

Ipinfodb.api_key = "your_api_key_here"
Ipinfodb.lookup('153.19.48.1')

You will receive the following Hash as a response (for successful lookups):

{
  "statusCode"    : "OK",
  "statusMessage" : "",
  "ipAddress"     : "153.19.48.1",
  "countryCode"   : "PL",
  "countryName"   : "POLAND"
}

Running tests

IPINFODB_API_KEY=<apikey> rake test

Copyright © 2011-2013 Tomasz Mazur, released under the MIT license