做微信QQ网络推广,听到最多的技术名称就是域名防封了,没被封过域名的推广肯定不是一个足够经验的推广,域名被封是正常的。
微信里推广,常在河边走,总会湿鞋的,我们的所说的防封就是用技术让域名生存的足够久,让公司采购域名的成本更低,减少很多工作,提高推广效率。
做到这一点还需要域名检测加域名轮换,域名被封了要及时发现,不然你推广出去的都是些被封的链接,别人看到你的链接显示是违规,显示违法网站,显然会让人有个坏印象,内心排斥和不信任,做文案或什么项目引流从而不顺利。
如果被封后没有及时得到通知而替换,那么公司所做其他推广都将是无用功,从而造成损失。
对域名检测软件有两要求,一是稳定性,软件持续的检测中途不能撂挑子,二是检测频率了,就是多久一次,有2秒/次,1秒/次,不限频率等等,2S/次的意思是2秒钟请求一次接口,
检测的办法很多,什么抓包,什么程序识图等等很多,看各家技术公司的水平了。
代码示例
$url = “http://api.monkeyapi.com”;
$params = array(
‘appkey’ =>‘appkey’,//您申请的APPKEY
‘url’ =>‘www.monkeyapi.com’,//需要查询的网站
);
p
a
r
a
m
s
t
r
i
n
g
=
h
t
t
p
b
u
i
l
d
q
u
e
r
y
(
paramstring = http_build_query(
paramstring=httpbuildquery(params);
c
o
n
t
e
n
t
=
C
u
r
l
(
content = Curl(
content=Curl(url, $paramstring);
r
e
s
u
l
t
=
j
s
o
n
d
e
c
o
d
e
(
result = json_decode(
result=jsondecode(content, true);
if(KaTeX parse error: Expected '}', got 'EOF' at end of input: …{ var_dump(result);
}else {
//请求异常
}
//想详细了解的可以+V mkapi002
/**
* 请求接口返回内容
* @param string $url [请求的URL地址]
* @param string $params [请求的参数]
* @param int
i
p
o
s
t
[
是
否
采
用
P
O
S
T
形
式
]
∗
@
r
e
t
u
r
n
s
t
r
i
n
g
∗
/
f
u
n
c
t
i
o
n
C
u
r
l
(
ipost [是否采用POST形式] * @return string */ function Curl(
ipost[是否采用POST形式]∗@returnstring∗/functionCurl(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;
}