Ruby gem for IP address geolocation via API calls to IPInfoDB.com.
gem install ipinfodb
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"
}
IPINFODB_API_KEY=<apikey> rake test
Copyright © 2011-2013 Tomasz Mazur, released under the MIT license