$ curl api.dhcp.cn/?json
{
"IP": "134.175.159.160",
"Address": {
"Country": "中国",
"Province": "广东省",
"City": "广州市"
},
"ISP": "电信"
}
$ curl -s api.dhcp.cn/?json | jq .IP
"134.175.159.160"
$ curl -s api.dhcp.cn/?json | jq ".Address"
{
"Country": "中国",
"Province": "广东省",
"City": "广州市"
}
$ curl -s api.dhcp.cn/?json | jq ".Address | length"
3
$ curl -s api.dhcp.cn/?json | jq .Address.City
"广州市"
$ curl -s 'api.dhcp.cn/?json' | \
python -c "import sys, json; print json.load(sys.stdin)['IP']"
134.175.159.160