Small script to geocode IP's using maxmind free database
requires go
Clone the repo and build with go build
Or just download the compiled binary for mac or linux in the bin folder (no windows yet, so contribute)
You may use this tool in 3 different ways (so far)
Using the command line, you can execute de geocode of a single IP address or passing a CSV file, geocode them all!
After building the project (or downloading the binaries), you can execute the following
fast_geocoder IP_ADDRESS
or
fast_geocoder path-to-some-csv-file
Both will print the result for the IP (or IPs) address you provided
The CSV file must contain a IP address string on the first column (only constraint)
You can also run a http server that can return the same results by calling the service on a provided port
fast_geocoder --server -port 80
Port is optional, it will run on port 8080 by default. Have in mind you must have the permissions to run on the provided port or the server wont run.
On the example above, you can make calls to
http://localhost/geocode/___IP_ADDRESS___
and receive a response on the format
{"lat": -33.4625, "lng": -70.6682, "country": "CL", "timezone": "America/Santiago"}
Fork, code, push, PR :)
Copyright © 2016 Thiago Costa This work is free. You can redistribute it and/or modify it under the terms of the Do What The Fuck You Want To Public License, Version 2, as published by Sam Hocevar. See the COPYING file for more details.