Skip to content

Instantly share code, notes, and snippets.

View mxamin's full-sized avatar

Amin Solhizadeh mxamin

View GitHub Profile
@mwatts272
mwatts272 / getUserGeographicDataFromIP.py
Last active December 17, 2015 18:59
An easy means of getting a Users Geographic Data based from their Internet Protocol Address. Please Note: Please only use your public IP Address, and not your routers self assigned IP Address.
#!/usr/bin/env python
"""
Retrieves Geographic Information (Location) of a specified IP Address
"""
import urllib
ipAddress = '50.57.97.17'
response = urllib.urlopen('http://www.geoplugin.net/json.gp?ip={0}' .format(ipAddress)).read()