diff --git a/ipip.alfredworkflow b/ipip.alfredworkflow index 9743106..de3e7d9 100644 Binary files a/ipip.alfredworkflow and b/ipip.alfredworkflow differ diff --git a/ipip.sh b/ipip.sh index a9c34b6..316898c 100755 --- a/ipip.sh +++ b/ipip.sh @@ -4,12 +4,17 @@ ip='{query}' result=$(curl -s https://www.ipip.net/ip.html -H "User-Agent: Safari/537.36" -H "Referer: https://www.ipip.net/" --data "ip=${ip}" --compressed) +# echo $ip +# echo "$result" + /bin/echo '' /bin/echo '' -address=`echo "$result" | grep '
' -A 1 |tail -n 1| sed "s/<\/span>//g" | sed "s/ //g"` -info=`echo "$result" |grep '' | sed -e 's/<[^>]*>//g' | sed "s/ //g" | sed "s/购买此数据//g" |sed "s/(.*)//g"` +address=`echo "$result" | grep '地理位置' -A 1 | head -n 2 |tail -n 1| sed -e 's/<[^>]*>//g' | sed "s/ //g"` + +info=`echo "$result" |grep 'IDC' |head -n 2|tail -n 1 | sed -e 's/<[^>]*>//g' | sed "s/ //g" |sed "s/(.*)//g"` + # echo $address # echo $info