如何快速知道域名是否被微信攔截停止訪問觅够?
分享一個域名是否被微信攔截的檢測接口平時用微信打開一些公司的網(wǎng)址态蒂,結果發(fā)現(xiàn)被停止訪問,對于這樣的情況辽社,對我們公司而言真的還是有很大的影響的伟墙,當時就各種想辦法,然后就找到了下面這個微信域名檢測接口滴铅,是實時檢測微信域名是否被攔截的戳葵,挺不錯的微信域名檢測接口百度搜索godtest
[if !supportLists]1.?[endif]
<?php
[if !supportLists]2.?[endif]
[if !supportLists]3.?[endif]
//您的?API?Token,在用戶中心可查詢到
[if !supportLists]4.?[endif]
[if !supportLists]5.?[endif]
$apiToken?=?"********************************";
[if !supportLists]6.?[endif]
[if !supportLists]7.?[endif]
//需要檢測的地址或域名
[if !supportLists]8.?[endif]
[if !supportLists]9.?[endif]
$reqUrl?=?"www.qq.com";
[if !supportLists]10.?[endif]
[if !supportLists]11.?[endif]
$url?=?sprintf("https://wx.godtest.cn.api/v1/wxUrlCheck?api_token=%s&req_url=%s",?$apiToken,?$reqUrl);
[if !supportLists]12.?[endif]
[if !supportLists]13.?[endif]
$ch?=?curl_init($url);
[if !supportLists]14.?[endif]
[if !supportLists]15.?[endif]
curl_setopt($ch,?CURLOPT_RETURNTRANSFER,?true);
[if !supportLists]16.?[endif]
[if !supportLists]17.?[endif]
curl_setopt($ch,?CURLOPT_BINARYTRANSFER,?true);
[if !supportLists]18.?[endif]
[if !supportLists]19.?[endif]
$responseBody?=?curl_exec($ch);
[if !supportLists]20.?[endif]
[if !supportLists]21.?[endif]
$responseArr?=?json_decode($responseBody,?true);
[if !supportLists]22.?[endif]
[if !supportLists]23.?[endif]
if?(json_last_error()?!=?JSON_ERROR_NONE)?{
[if !supportLists]24.?[endif]
[if !supportLists]25.?[endif]
echo?"JSON解析接口結果出錯\n";
[if !supportLists]26.?[endif]
[if !supportLists]27.?[endif]
????return;
[if !supportLists]28.?[endif]
[if !supportLists]29.?[endif]
}
[if !supportLists]30.?[endif]
[if !supportLists]31.?[endif]
if?(isset($responseArr['code'])?&&?$responseArr['code']?==?0)?{
[if !supportLists]32.?[endif]
[if !supportLists]33.?[endif]
//接口正確返回
[if !supportLists]34.?[endif]
[if !supportLists]35.?[endif]
//?$responseArr['data']['status']的取值范圍:ok汉匙、blocked
[if !supportLists]36.?[endif]
[if !supportLists]37.?[endif]
//?ok表示正常拱烁、blocked?表示被封
[if !supportLists]38.?[endif]
[if !supportLists]39.?[endif]
printf("測試地址(%s)的狀態(tài)為:%s\n",?$reqUrl,?$responseArr['data']['status']);
[if !supportLists]40.?[endif]
[if !supportLists]41.?[endif]
}?else?{
[if !supportLists]42.?[endif]
[if !supportLists]43.?[endif]
printf("接口異常:%s\n",?var_export($responseArr,?true));
[if !supportLists]44.?[endif]
[if !supportLists]45.?[endif]
}
[if !supportLists]46.?[endif]
復制代碼