The geolocation_proxycheck script is used to geolocate IP addresses from CSV file by two databases the MaxMind GeoIP and the IP2Location IP2Lite. Script can be also used to check IP addresses on proxy by the IP2Location IP2Proxy database. Input CSV file must have header with "ip" column. Output file contains:
- Country Code
- Country Name
- Latitude & Longitude
- Proxy Type
Ruby and Bundler installation is required. After that run inside project from your command line:
$ bundle install
- For help run this command:
$ ./geolocation_service.rb -h
- Help output:
usage: geolocation_service.rb [options]
-h, --help Show help.
-u, --update Update all databases.
-up, --updatep Update proxy database.
-ul, --updateip2 Update IP2Location database.
-um, --updatemm Update MaxMind database.
-i, --input Add name of input file with data.
-m, --maxmind Geolocate by MaxMind.
-l, --ip2location Geolocate by IP2Location.
-p, --proxy Check proxy.
-v, --visualise Create a visualisation map.
- Update all databases:
$ ./geolocation_service.rb -u
- Update MaxMind database:
$ ./geolocation_service.rb -um
- Update IP2Location database:
$ ./geolocation_service.rb -ul
- Update proxy database:
$ ./geolocation_service.rb -up
- Geolocate IP addresses stored in CSV file by free MaxMind GeoLite2 City Database:
$ ./geolocation_service.rb -i example.csv -m
- Geolocate IP addresses stored in CSV file by free IP2Location LITE IP-COUNTRY-REGION-CITY-LATITUDE-LONGITUDE Database:
$ ./geolocation_service.rb -i example.csv -l
- Check IP addresses to proxy by free IP2Location IP2Proxy LITE IP-COUNTRY Database:
$ ./geolocation_service.rb -i example.csv -p
- Visualise output data on the map:
$ ./geolocation_service.rb -i example.csv -v
This application includes:
- IP2Location LITE data available from http://lite.ip2location.com.
- GeoLite2 data created by MaxMind, available from http://www.maxmind.com.