comment
This commit is contained in:
1 parent
89138887cc
commit
b52421c8b0
1 file changed
+1
@@ -13,6 +13,7 @@ def save_cursor(c):
|
|||||||
open(STATE, "w").write(c)
|
open(STATE, "w").write(c)
|
||||||
|
|
||||||
def geo(ip):
|
def geo(ip):
|
||||||
|
print(f"Send geo request for {ip}")
|
||||||
r = requests.get(f"http://ip-api.com/json/{ip}", timeout=5).json()
|
r = requests.get(f"http://ip-api.com/json/{ip}", timeout=5).json()
|
||||||
if r["status"] == "success":
|
if r["status"] == "success":
|
||||||
return r["country"], r["lat"], r["lon"]
|
return r["country"], r["lat"], r["lon"]
|
||||||
|
|||||||
Reference in new issue
Block a user