Last active
September 25, 2024 18:11
-
-
Save bng44270/786351bd722dcef09333719630c55b92 to your computer and use it in GitHub Desktop.
Used with TikTok video posted on 9/25/2024 - for more information visit https://ifconfig.co
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
def IFCJson(): | |
url = 'https://ifconfig.co/json' | |
resp = requests.get(url) | |
obj = resp.json() | |
lat = obj['latitude'] | |
lng = obj['longitude'] | |
ip = obj['ip'] | |
print(f"{ip} ({lat},{lng})") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment