Skip to content

Instantly share code, notes, and snippets.

@aburgd
Created December 28, 2016 03:34
Show Gist options
  • Save aburgd/7900b9c12a6b2f47d0072b2d4fbc6639 to your computer and use it in GitHub Desktop.
Save aburgd/7900b9c12a6b2f47d0072b2d4fbc6639 to your computer and use it in GitHub Desktop.
import requests
url = "https://wtfismyip.com/json"
headers = {"user-agent": "FuckProtocol/0.1.0"}
def make_the_call():
response = requests.get(url=url, headers=headers)
resp_data = response.json()
return resp_data
data = make_the_call()
hostname = data['YourFuckingHostname']
ip_addr = data['YourFuckingIPAddress']
print("Your Fucking Hostname: ", hostname)
print("Your Fucking IP Address: ", ip_addr)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment