Created
March 4, 2016 06:35
-
-
Save supertask/c4ce5ef91222906f3f14 to your computer and use it in GitHub Desktop.
A script finding a real address from ip address.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import geoip2.database | |
reader = geoip2.database.Reader('/usr/local/share/Geoip/GeoLite2-City.mmdb') | |
import sys | |
ip_address = raw_input('ip address -> ') | |
response = reader.city(ip_address) | |
print "%s, %s, %s" % (response.country.name, response.subdivisions.most_specific.name, response.city.name) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment