I'm using this python code to get the users ip address:
import socket
print socket.gethostbyname(socket.gethostname())
and using this to find their location:
import socket
print socket.gethostbyname(socket.gethostname())
import urllib
response = urllib.urlopen('http://api.hostip.info/get_html.php? ip=xxx&position=true').read()
print(response)
Could someone please help me find a way to get the ip and then put it into the second part of the code. The program should find the users ip without them doing anything and then show the location.
Thanks.