yugan300 发表于 2017-7-4 15:15:47

Eric.c 发表于 2017-7-4 16:22:51

给你撸一个监控的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);
        }
}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);
}




maozedong 发表于 2017-7-4 15:20:53

Eric.c 发表于 2017-7-4 15:23:43

本帖最后由 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);
}




莫拉格 发表于 2017-7-4 15:25:56

Eric.c 发表于 2017-7-4 15:23
给你撸一个监控的php代码,一旦促销页面有变化,通知你。




yc012t怎么用

yugan300 发表于 2017-7-4 15:29:19

优秀的苦瓜 发表于 2017-7-4 15:41:35

yhqdq 发表于 2017-7-4 17:03:37

Eric.c 发表于 2017-7-4 16:22
给你撸一个监控的php代码,一旦促销页面有变化,通知你。

精简牛逼!

Eric.c 发表于 2017-7-4 17:13:08

yhqdq 发表于 2017-7-4 17:03
精简牛逼!

必须的!
页: [1]
查看完整版本: online今天还上特价机器吗?85欧的挂一天了