Created
October 10, 2019 00:45
-
-
Save whoo/527a231eab8c5bad334d4c39bf9da08f to your computer and use it in GitHub Desktop.
test
This file contains hidden or 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
# wget "https://geolite.maxmind.com/download/geoip/database/GeoLite2-City.tar.gz" | |
# | |
import geoip2.database | |
reader = geoip2.database.Reader('./GeoLite2-City.mmdb') | |
listtt=""" | |
8.8.8.8 | |
123.12.12.12 | |
23.23.2.2 | |
""" | |
ip="127.0.0.1" | |
for l in listt.split("\n"): | |
if (l is not ""): | |
response = reader.city(l) | |
print("{};{};{} ".format(l,response.country.iso_code, response.city.name)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment