Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100755 23 lines (18 sloc) 0.504 kb
4ec7259 @jlopez Initial commit - v1.2.4
authored
1 #!/usr/bin/python
2
3 import GeoIP
4
5 gi = GeoIP.open("/usr/local/share/GeoIP/GeoIPCity.dat",GeoIP.GEOIP_STANDARD)
6
7 gir = gi.record_by_name("www.google.com")
8 #gir = gi.record_by_addr("24.24.24.24")
9
10 if gir != None:
11 print gir['country_code']
12 print gir['country_code3']
13 print gir['country_name']
14 print gir['city']
15 print gir['region']
16 print gir['region_name']
17 print gir['postal_code']
18 print gir['latitude']
19 print gir['longitude']
20 print gir['area_code']
21 print gir['time_zone']
22 print gir['metro_code']
Something went wrong with that request. Please try again.