How to detect whether the wechat domain name is blocked in real time

Keywords: PHP network curl

I believe that many businesses, including webmasters, companies, studios, etc., are promoting and sending domain names in wechat and QQ. But at the same time, there will be many problems. If you don't understand the rules of wechat, the domain name will be blocked. If you are blocked, you will be prompted, unable to open, easy to lose customers, and can't watch the domain name all the time. If there are only a few companies and studios that can query domain names, but if there are hundreds or thousands of domain names or even more, it's not the same. It's impossible to check so many domain names one by one, and many software are not very accurate. Then it can be realized through the monkey data wechat / QQ domain name detection interface. Monkey data specially provides wechat / QQ domain name detection interface for domain name detection, which can query and detect whether the domain name is blocked by wechat / QQ in real time. Monkey data uses the latest technology of the whole network. It uses protocol detection. The protocols are distributed on different servers. The technologies are all from Huawei and Tencent. The stability is as high as 99.999%. The response speed of monkey data wechat domain name detection interface can be as fast as milliseconds each time. Users can also choose different frequency packages according to different needs.
Next, I will show you a section of our code industry reference. What you need + WX: mkapi002 QQ: 2798913756

$url = "http://api.monkeyapi.com";
$params = array(
'appkey' =>'appkey',//APPKEY you applied for
'url' =>'www.monkeyapi.com',//Websites to query
);

$paramstring = http_build_query($params);
$content = monkeyCurl($url, $paramstring);
$result = json_decode($content, true);
if($result) {
    var_dump($result);
}else {
    //Request exception
}

/**
    * Request interface return content
    * @param    string $url [Requested URL address]
    * @param    string $params [Requested parameters]
    * @param    int $ipost [POST or not]
    * @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;
}

Posted by mtucker6784 on Sun, 01 Dec 2019 23:48:05 -0800