4 ms·
That's clever and useful. Thanks. I've used http://checkip.dyndns.org http://checkip.dyndns.org for this problem for years, but this is an improvement. Chec
by jjguy 16y ago
That's clever and useful. Thanks. I've used http://checkip.dyndns.org http://checkip.dyndns.org for this problem for years, but this is an improvement. Checkip:
>>> url = urllib2.urlopen("http://checkip.dyndns.org")
>>> url.read()
'<html><head><title>Current IP Check</title></head><body>Current IP Address: 192.168.0.1</body></html>\r\n'
Details here: http://www.dyndns.com/developers/checkip.html http://www.dyndns.com/developers/checkip.html
It's not as easy to parse as JSON, but nor is it very difficult. The format has not changed in years; I've got a regex running I haven't needed to adjust since day 1.
- callahad 16y agoYou could also use: http://www.whatismyip.com/automation/n09230945.asp http://www.whatismyip.com/automation/n09230945.asp
- pavel_lishin 16y agoWhat a convenient URL to remember.
- spicyj 16y agoFor a while, http://whatismyip.org/ http://whatismyip.org/ returned your IP in plain text, but no longer.
- deleted 16y ago[deleted]
- electrum 16y agoTry this: http://myip.dnsomatic.com/ http://myip.dnsomatic.com/ Documented here: http://dnsomatic.com/wiki/api#detecting_changes http://dnsomatic.com/wiki/api#detecting_changes