Skip to content

Instantly share code, notes, and snippets.

@Lvl4Sword
Created March 20, 2016 08:16
Show Gist options
  • Save Lvl4Sword/ad68a935ce4a1f4d4949 to your computer and use it in GitHub Desktop.
Save Lvl4Sword/ad68a935ce4a1f4d4949 to your computer and use it in GitHub Desktop.
DuckDuckGo IP Lookup
import requests
import json
raw = requests.get('https://api.duckduckgo.com/?q=ip&format=json')
raw_json = json.loads(raw.text)
answer = raw_json["Answer"].split(' ')
print (' '.join(answer[:5]))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment