Giter Site home page Giter Site logo

monitor_for_kimsufi's Introduction

Kimsufi Monitor

此前PHP版本的Kimsufi上货监控由于OVH更改了程序逻辑,已经彻底失效了。所以重新使用Python3写了一个Kimsufi上货监控。提醒方式由之前的server酱发微信消息换成了电报/telegram机器人推送通知,因为新版的server酱每天只有5条免费的推送额度,无法满足监控的多推送要求。

环境要求

支持的系统:CentOS 7+, Ubuntu 18.04+, Debian 9+等
软件和环境:Python3、pip

如果没有安装pip,可使用以下命令进行安装:

yum install python3-pip -y #适用于CentOS
apt install python3-pip -y #适用于Ubuntu和Debian

安装Python脚本,使用crontab定时运行

/home文件夹中(也可以是其他路径),执行以下命令。

首先,使用以下命令安装脚本的依赖包:

pip install jsonpath
pip install requests

其次,下载脚本并修改参数:

wget --no-check-certificate -O kimsufi.py https://raw.githubusercontent.com/uselibrary/monitor_for_kimsufi/master/kimsufi.py && chmod +x kimsufi.py

使用vim、nano或者任何你常用的编辑器打开kimsufi.py,配置以下内容:

country_code = 'eu'
hardware_code = '2201sk040'
chat_id_code = '521704743'
token_code = '170491216:SFR-F456_Rcm4-WwBHBdicBHailBgB'

其中,country_code 后面的是账号的所在地,比如欧区的是eu,美区的是us;hardware_code是机器的代号,比如欧区的KS-1的代号是2201sk010(区域和对应的机器代号要匹配,具体代码可以查看网页源代码);chat_id_code是telegram机器人的chat id;token_code是telegram机器人的token。不会电报机器人或者没有申请机器人的,请参考这里:https://pa.ci/119.html 跟随申请telegram bot部分进行操作即可。

最后,使用crontab定时运行脚本:

在终端中输入crontab -e,在其中输入以下内容(注意kimsufi.py的路径):

*/1 * * * * /usr/bin/python3 /home/kimsufi.py

至此,就完成了Kimsufi的监控,每分钟检查一次是否有货,一旦发现有货,就会在电报/telegram上推送消息,并给出具体是哪个机房有货。





以下是基于PHP的旧版本,已经失效,请使用Python版本

这是一个用于监控kimsufi独立服务器的PHP程序。 将kimsufi.php放在任意文件夹之中,比如/var/www/html下。

1.安装PHP5.x或者PHP7.x环境

Redhat/CentOS系:

yum install php

Debian系:

apt-get install php5
2.使用crontab定时运行
crontab -e
*/1 * * * * /usr/bin/php -f /var/www/html/kimsufi.php
3.使用方糖实现微信推送

将kimsufi.php最后一行的file_get_contents内容更换为你自己的key,申请地址为:http://sc.ftqq.com

4.添加自己需要的检测

格式如下,填写

if(checkKimsufi("174sk94"))
{
    send("新版ks4a特价有货", $desp = 'https://www.kimsufi.com/en/order/kimsufi.cgi?hard=174sk94');
}

原始技术来源于来源于http://www.hostloc.com/thread-408681-1-1.html.

monitor_for_kimsufi's People

Contributors

uselibrary avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.