Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
caorong committed May 26, 2018
1 parent 8a96130 commit 7a8f4b4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Binary file modified ipip.alfredworkflow
Binary file not shown.
9 changes: 7 additions & 2 deletions ipip.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 '<?xml version="1.0"?>'
/bin/echo '<items>'

address=`echo "$result" | grep '<div><span id=\"myself\">' -A 1 |tail -n 1| sed "s/<\/span>//g" | sed "s/ //g"`

info=`echo "$result" |grep '<td style=\"text-align: center;\">' | 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
Expand Down

0 comments on commit 7a8f4b4

Please sign in to comment.