标签:pos 程序 field 微信域名检测 tran isp close com erro
最近在网上看到很多网友在问微信域名拦截检测API接口。有的是想找一个稳定靠谱的服务商,有的是刚接触这方面的业务想通过程序来代替之前的人工检测,更有甚者想具体了解微信域名检测API接口的原理,当然这部分人群大多数是技术人员或者是喜欢研究的。不管你是出于什么目的,猴子数据作为一个研究接口服务多年的服务商来说这个接口的原理是非常简单的,而且产品基本上也很成熟。如果不是想深入接口行业而只是用这个工具,建议直接购买服务即可,着重考虑营销方面可能更有必要。猴子数据今天在这里分享一段代码供大家参考,如有不懂的地方可以交流学习。
$url = "http://api.monkeyapi.com";
$params = array(
‘appkey‘ =>‘appkey‘,//您申请的APPKEY
‘url‘ =>‘www.monkeyapi.com‘,//需要查询的网站
);
$paramstring = http_build_query($params);
$content = monkeyCurl($url, $paramstring);
$result = json_decode($content, true);
if($result) {
var_dump($result);
}else {
//请求异常
}
/**
* 请求接口返回内容
* @param string $url [请求的URL地址]
* @param string $params [请求的参数]
* @param int $ipost [是否采用POST形式]
* @return string
*/
function monkeyCurl($url, $params = false, $ispost = 0)
{
$httpInfo = array();
$ch = curl_init();
curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 60);
curl_setopt($ch, CURLOPT_TIMEOUT, 60);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
if ($ispost) {
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $params);
curl_setopt($ch, CURLOPT_URL, $url);
}else {
if ($params) {
curl_setopt($ch, CURLOPT_URL, $url.‘?‘.$params);
} else {
curl_setopt($ch, CURLOPT_URL, $url);
}
}
$response = curl_exec($ch);
if ($response === FALSE) {
//echo "cURL Error: " . curl_error($ch);
return false;
}
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
$httpInfo = array_merge($httpInfo, curl_getinfo($ch));
curl_close($ch);
return $response;
}
API接口检测可以实现微信域名实时检测是否被封。频率可以选择2S/次 1S/次和无限制请求,具体根据自身请求情况来选择。自动切换的demo我没发出来,不懂的可以wx:xcxsf001 或者进我们官网 “www.monkeyapi.com”了解
标签:pos 程序 field 微信域名检测 tran isp close com erro
原文地址:https://www.cnblogs.com/newapi/p/10293011.html