<?php
$key = 'SCU6641T52d189fd61c651c03ba188a41a2280a558c8155d8c56e';
$data = file_get_contents("https://www.online.net/en/summer-2017/sales");
if(file_exists("hash.key")){
$key = file_get_contents("hash.key");
if($key == md5($data))
{
#same
}else {
sc_send("online page change","page change ",$key);
}
}else
{
file_put_contents("hash.key",md5($data));
}
function sc_send($text, $desp = '', $key ="") {
$postdata = http_build_query(
array('text' => $text, 'desp' => $desp));
$opts = array('http' =>
array(
'method'=> 'POST',
'header'=> 'Content-type: application/x-www-form-urlencoded',
'content' => $postdata
)
);
$context = stream_context_create($opts);
return $result = file_get_contents('http://sc.ftqq.com/'.$key.'.send', false, $context);
}
本帖最后由 Eric.c 于 2017-7-4 23:07 编辑
给你撸一个监控的php代码,一旦促销页面有变化,通知你。
<?php
$key = 'SCU6641T52d189fd61c651c03ba188a41a2280a558c8155d8c56e';
$data = file_get_contents("https://www.online.net/en/summer-2017/sales");
if(file_exists("hash.key")){
$key = file_get_contents("hash.key");
if($key == md5($data))
{
#same
}else {
sc_send("online page change","page change ",$key);
file_put_contents("hash.key",md5($data));
}
}else
{
file_put_contents("hash.key",md5($data));
}
function sc_send($text, $desp = '', $key ="") {
$postdata = http_build_query(
array('text' => $text, 'desp' => $desp));
$opts = array('http' =>
array(
'method'=> 'POST',
'header'=> 'Content-type: application/x-www-form-urlencoded',
'content' => $postdata
)
);
$context = stream_context_create($opts);
return $result = file_get_contents('http://sc.ftqq.com/'.$key.'.send', false, $context);
}
Eric.c 发表于 2017-7-4 15:23
给你撸一个监控的php代码,一旦促销页面有变化,通知你。
yc012t怎么用 Eric.c 发表于 2017-7-4 16:22
给你撸一个监控的php代码,一旦促销页面有变化,通知你。
精简牛逼! yhqdq 发表于 2017-7-4 17:03
精简牛逼!
必须的!
页:
[1]