Dec-30-2016, 09:08 AM
since i have been working on a module/command to get the user's current public IP address, as the world sees it, and web queries seem to be the way to go, i have done some searching and found several with easy output (mostly JSON or a raw IP) and decided to share my list.
connected to 'https://api.ipify.org?format=json' response = '{"ip":"10.20.30.40"}' connected to 'http://jsonip.com/' response = '{"ip":"10.20.30.40","about":"/about","Pro!":"http://getjsonip.com"}' connected to 'http://icanhazip.com' response = '10.20.30.40\n' connected to 'http://ipinfo.io/ip' response = '10.20.30.40\n' connected to 'http://whatismyip.akamai.com/' response = '10.20.30.40' connected to 'http://checkip.dyndns.org/' response = '<html><head><title>Current IP Check</title></head><body>Current IP Address: 10.20.30.40</body></html>\r\n' connected to 'http://ipinfo.io/json' response = '{\n "ip": "10.20.30.40",\n "hostname": "host.name",\n "city": "",\n "region": "",\n "country": "XX",\n "loc": "lat,long'\ connected to 'https://ipinfo.io/json' response = '{\n "ip": "10.20.30.40",\n "hostname": "host.name",\n "city": "",\n "region": "",\n "country": "XX",\n "loc": "lat,long'\ connected to 'https://ifconfig.co/json' response = '{"ip":"10.20.30.40","ip_decimal":169090600,"country":"Countyname","city":"Unknown","hostname":"host.name"}' connected to 'https://api.ipify.org?format=json' response = '{"ip":"10.20.30.40"}'edit 1: show each response format like a python string literal assignment