This script scans given text to find urls and IP addresses. The output is the same text but every url and IP address is going to have its geolocation appended.
This program accepts any text and searchs inside every IP address. With each of those IP addresses, geolocate queries Maxmind GeoIP database to look for the city and country where IP or URL is located.
Geolocate is designed to be used in console with pipes and redirections along with applications like traceroute, etc. Geolocate’s output is the same text than input but IP is going to have appended its country and city and long-lat coordinates (depending on verbosity level).
It has two main running modes:
- Stream mode: used to parse piped output from other programs.
$ traceroute -n www.google.com | ./geolocate.py -v 3 -s traceroute to www.google.com (184.108.40.206 [North America | United States | Mountain View | 37.419200000000004, -122.0574]), 30 hops max, 60 byte packets 1 * * * 2 * * * 3 * * * 4 * * * 5 * * * 6 220.127.116.11 [Europe | Spain | Unknown city | 40.0, -4.0] 12.277 ms 9.252 ms 8.790 ms 7 18.104.22.168 [North America | United States | Mountain View | 37.419200000000004, -122.0574] 19.491 ms 16.614 ms 16.687 ms 8 22.214.171.124 [Europe | United Kingdom | Unknown city | 51.5, -0.13] 16.614 ms 16.010 ms 16.025 ms 9 126.96.36.199 [North America | United States | Mountain View | 37.419200000000004, -122.0574] 15.988 ms 14.372 ms 14.321 ms
- Text mode: used to parse a given string of text.
$ ./geolocate.py "188.8.131.52" -v 3 184.108.40.206 [North America | United States | Mountain View | 37.419200000000004, -122.0574]
For further information about how to use geolocate, please refer to it Geolocate Homepage.
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
|File Name & Checksum SHA256 Checksum Help||Version||File Type||Upload Date|
|geolocate-1.0.0-py3-none-any.whl (19.9 kB) Copy SHA256 Checksum SHA256||py3||Wheel||Mar 2, 2015|
|geolocate-1.0.0.tar.gz (14.6 kB) Copy SHA256 Checksum SHA256||–||Source||Mar 2, 2015|