Skip to content

Instantly share code, notes, and snippets.

@Gilinho
Last active November 30, 2017 10:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Gilinho/b2728cf674c93709ec60178a370bd06e to your computer and use it in GitHub Desktop.
Save Gilinho/b2728cf674c93709ec60178a370bd06e to your computer and use it in GitHub Desktop.
import urllib, json
data = json.loads(urllib.urlopen("http://ip.jsontest.com/").read())
print data["ip"]
#OR Without json
#
#import urllib, re
#
#data = re.search('"([0-9.]*)"', urllib.urlopen("http://ip.jsontest.com/").read()).group(1)
#print data
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment