No commit activity in last 3 years
No release in over 3 years
Simple geocoder gem extention to use custom ip lookup api
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

> 1.3.0
 Project Readme

geocoder/izi_lookup

One more useless plugin

Usage

How to use my plugin.

Installation

Add this line to your application's Gemfile:

gem 'geocoder'
gem 'geocoder-izi-lookup', require: 'geocoder/izi_lookup'

And then execute:

$ bundle

Or install it yourself as:

$ gem install geocoder-izi-lookup

Now you can use this configuration to use own lookup service:

Geocoder.configure(
  cache: Rails.cache,
  cache_prefix: 'geocoder:',
  ip_lookup: :izi_geoip,
  izi_geoip: {
    host: 'https://[YOUR_LOOKUP_SERVICE]'
  }
)

your service should respond by url:

https://[YOUR_LOOKUP_SERVICE]/geocode.json?ip=[IP_FOR_LOOKUP]

and return value:

{
  "ip": "123.45.67.89",
  "continent_code": "EU",
  "continent_name": "Europe",
  "country_code": "UA",
  "country_name": "Ukraine",
  "location_latitude": "",
  "location_longitude": "",
  "location_time_zone": "",
  "postal_code": "",
  "version": "0.1.1",
  "in_eu": "false"
}

server writen on Crystal here: https://hub.docker.com/r/izikaj/geoip/

Contributing

Contribution directions go here. TODO

Tests

TODO

License

The gem is available as open source under the terms of the MIT License.