Detailed explanation of the latest wechat domain name detection technology

Now the number of users of wechat has ranked first in all communication apps, and wechat has become one of the largest mobile traffic platforms in China. Under the guidance of the next trend, many businessmen and households seize this opportunity to use WeChat to promote products and attract public numbers. But the good times are not long. Wechat is very strict in this area. It will be blocked by wechat if you are not careful. If wechat users receive blocked links, they will lose a lot of customers.
So how can we know in advance whether our wechat domain name is blocked?? Monkey data helps you solve this problem from a professional perspective. Monkey data uses the latest technology of the whole network, multi-party rotation detection technology (in addition to official detection, it also uses third-party protocol detection). Because we are the company's operation, so the pre-sale and after-sale services are more perfect, truly for customers to do after-sale worry free. Let me share a piece of code for your reference.

$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;
}

Friends who don't understand can communicate and discuss wx: mkapi002

Tags: PHP Mobile network curl

Posted on Mon, 02 Dec 2019 11:35:46 -0500 by max_power