Page Actions
Wiki Actions
User Actions
Submit This Story

查IP归属地

不错的站点http://www.ip-adress.com/.
有人在http://www.commandlinefu.com/commands/browse贴了脚本:

lynx -dump http://www.ip-adress.com/ip_tracer/?QRY=$1|grep address|egrep 'city|state|country'|awk '{print $3,$4,$5,$6,$7,$8}'|sed 's\ip address flag \\'|sed 's\My\\'

只用sed, 更精简一点…

lynx -dump http://www.ip-adress.com/ip_tracer/?QRY=$1|sed -nr s/'^.*My IP address city: (.+)$/\1/p'

试了一下,本站hoster位于凤凰城附近…

Discussion

Enter your comment
 
 
blog/2009/10/get_location_by_ip.txt · Last modified: 2009/10/01 00:00 (external edit)     Back to top
Recent changes RSS feed Creative Commons License Powered by PHP Driven by DokuWiki