这里会显示出您选择的修订版和当前版本之间的差别。
两侧同时换到之前的修订记录 前一修订版 后一修订版 | 前一修订版 | ||
api:ip2region [2019/11/02 20:48] admin |
api:ip2region [2020/10/30 09:17] (当前版本) admin |
||
---|---|---|---|
行 13: | 行 13: | ||
[[https://api.xlongwei.com/service/ip/region.json|示例2]] | [[https://api.xlongwei.com/service/ip/region.json|示例2]] | ||
[[http://cms.xlongwei.com/demo/headers.html|演示]] | [[http://cms.xlongwei.com/demo/headers.html|演示]] | ||
+ | |||
+ | * 变更ip地址,[[https://github.com/stedolan/jq/releases/download/jq-1.3/jq-linux-x86_64|jq]] | ||
+ | * 查询ip:curl https://api.xlongwei.com/service/ip/region.json | ||
+ | * 请求变更:curl https://api.xlongwei.com/weixin/chat.json?text=ip%3D&openid= | ||
+ | * 公众号发送:ip= | ||
+ | * 配置:{token:{token},{openid}={recordId}} | ||
+ | * 执行请求:curl https://log.xlongwei.com/log?type=alidns&recordId=&ip=,需校验token | ||
+ | |||
+ | <code> | ||
+ | openid= | ||
+ | #json=`curl -s https://api.xlongwei.com/service/ip/region.json` | ||
+ | json='{"country":"中国","area":"","state":"山东省","city":"青岛市","isp":"阿里云","region":"中国山东省青岛市阿里云","ip":"115.28.229.158"}' | ||
+ | echo "openid=$openid json=$json" | ||
+ | ip=`echo $json | jq '.ip'` | ||
+ | echo "ip=$ip" | ||
+ | #curl -s https://api.xlongwei.com/service/weixin/chat.json?openid=${openid}&text=ip%3D${ip} | ||
+ | </code> | ||
+ | |||
+ | |||