全球主机交流论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

CeraNetworks网络延迟测速工具IP归属甄别
查看: 1425|回复: 8

online今天还上特价机器吗?85欧的挂一天了

[复制链接]
发表于 2017-7-4 15:15:47 | 显示全部楼层 |阅读模式
提示: 作者被禁止或删除 内容自动屏蔽
发表于 2017-7-4 16:22:51 | 显示全部楼层
给你撸一个监控的php代码,一旦促销页面有变化,通知你。




  1. <?php

  2. $key = 'SCU6641T52d189fd61c651c03ba188a41a2280a558c8155d8c56e';

  3. $data = file_get_contents("https://www.online.net/en/summer-2017/sales");
  4. if(file_exists("hash.key")){

  5.         $key = file_get_contents("hash.key");
  6.         if($key == md5($data))
  7.         {
  8.                         #same
  9.         }else        {

  10.                         sc_send("online page change","page change ",$key);
  11.         }
  12. }else
  13. {
  14.         file_put_contents("hash.key",md5($data));
  15. }



  16. function sc_send($text, $desp = '', $key ="") {
  17.     $postdata = http_build_query(
  18.     array('text' => $text, 'desp' => $desp));
  19.     $opts = array('http' =>
  20.         array(
  21.             'method'  => 'POST',
  22.             'header'  => 'Content-type: application/x-www-form-urlencoded',
  23.             'content' => $postdata
  24.         )
  25.     );
  26.     $context = stream_context_create($opts);
  27.     return $result = file_get_contents('http://sc.ftqq.com/'.$key.'.send', false, $context);
  28. }




复制代码
发表于 2017-7-4 15:23:43 | 显示全部楼层
本帖最后由 Eric.c 于 2017-7-4 23:07 编辑

给你撸一个监控的php代码,一旦促销页面有变化,通知你。




  1. <?php

  2. $key = 'SCU6641T52d189fd61c651c03ba188a41a2280a558c8155d8c56e';

  3. $data = file_get_contents("https://www.online.net/en/summer-2017/sales");
  4. if(file_exists("hash.key")){

  5.         $key = file_get_contents("hash.key");
  6.         if($key == md5($data))
  7.         {
  8.                         #same
  9.         }else        {

  10.                         sc_send("online page change","page change ",$key);
  11.                               file_put_contents("hash.key",md5($data));

  12.         }
  13. }else
  14. {
  15.         file_put_contents("hash.key",md5($data));
  16. }



  17. function sc_send($text, $desp = '', $key ="") {
  18.     $postdata = http_build_query(
  19.     array('text' => $text, 'desp' => $desp));
  20.     $opts = array('http' =>
  21.         array(
  22.             'method'  => 'POST',
  23.             'header'  => 'Content-type: application/x-www-form-urlencoded',
  24.             'content' => $postdata
  25.         )
  26.     );
  27.     $context = stream_context_create($opts);
  28.     return $result = file_get_contents('http://sc.ftqq.com/'.$key.'.send', false, $context);
  29. }




复制代码
发表于 2017-7-4 15:25:56 | 显示全部楼层
Eric.c 发表于 2017-7-4 15:23
给你撸一个监控的php代码,一旦促销页面有变化,通知你。

怎么用
 楼主| 发表于 2017-7-4 15:29:19 | 显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽
优秀的苦瓜 该用户已被删除
发表于 2017-7-4 15:41:35 | 显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽
发表于 2017-7-4 17:03:37 | 显示全部楼层
Eric.c 发表于 2017-7-4 16:22
给你撸一个监控的php代码,一旦促销页面有变化,通知你。

精简  牛逼!
发表于 2017-7-4 17:13:08 | 显示全部楼层
yhqdq 发表于 2017-7-4 17:03
精简  牛逼!

必须的!
您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|手机版|小黑屋|全球主机交流论坛

GMT+8, 2024-10-7 11:22 , Processed in 0.068948 second(s), 10 queries , Gzip On, MemCache On.

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表