MyIP | Free

Disclaimer: This application reports and records your IP address and coordinates

############################
##     MyIP | by pcondemand      ##
############################

import requests
from time import sleep
from tkinter import *
import urllib.request, json

try:
  url = "https://ipinfo.io"
  req=urllib.request.Request(url)
  with urllib.request.urlopen(req) as response:
      data = response.read()
      data=json.loads(data)
except:
  print("Connection N/A")      

coor=data['loc'].split(',')
lat=coor[0]
lon=coor[1]
coor1=(lat,lon)

root=Tk()
root.title("MyIP | by pcondemand")

for i,recs in enumerate (data):
    button1=Button(root,text=recs)
    button1.grid(row=i,column=0,sticky=W,pady=2)
    entry1=Label(root,text=data[recs])
    entry1.grid(row=i,column=1,sticky=W,pady=2)

url='https://api.myjson.com/bins/xncj0'
a=requests.get(url)
j=a.json()
content=[{data['ip']:(lat,lon,'myip')}]
for recs in j:
    content.append(recs)
header = {"Content-Type" : "application/json"}
requests.put(url, data=json.dumps(content), headers=header)
root.mainloop()