Monitor robot of Apple Store's products, using DingTalk notification.

Overview

概述

本项目应用主要用来监测Apple Store线下直营店货源情况,主要使用Python实现。

首先感谢iPhone-Pickup-Monitor项目带来的灵感,同时有些实现也直接使用了该项目的一些代码。

本项目在iPhone-Pickup-Monitor原有功能的基础上去掉了声音通知,但添加了多货源同时监控以及钉钉消息通知功能。

安装

# 拉取代码 
git clone https://github.com/LennonChin/AppleStore-Monitor.git

# 进入目录
cd AppleStore-Monitor

# 安装依赖
pip install -r requirements.txt

申请钉钉群机器人

【强烈建议配置】如不配置则没有通知功能。

本监控提供了钉钉监控的功能,可以在监控到有货源时将消息发送到钉钉群。如要启用该功能,首先需要创建一个钉钉群,并添加群机器人,详细可参考文档:

自定义机器人接入

机器人配置完毕后,记下相关的Access Token和Secret Key,后面配置时需要用到。

开始配置

可以配置多个监控商品:

$> python monitor.py config
--------------------
[0] AirPods
[1] iPhone 13
选择要监控的产品:0
--------------------
[0] AirPods
[1] AirPods Max
选择要监控的产品子类:1
--------------------
[0] AirPods Max - 银色
选择要监控的产品型号:0
--------------------
是否添加更多产品[Enter继续添加,非Enter键退出]:
--------------------
[0] AirPods
[1] iPhone 13
选择要监控的产品:1
--------------------
...
[3] iPhone 13 Pro Max
选择要监控的产品子类:3
--------------------
...
[11] 512GB 远峰蓝色
...
选择要监控的产品型号:11
--------------------
是否添加更多产品[Enter继续添加,非Enter键退出]:n
选择计划预约的地址:
请稍后...1/3
--------------------
[0] 北京
[1] 上海
...
请选择序号:1
请稍后...2/3
请稍后...3/3
--------------------
[0] 黄浦区
...
请选择序号:0
正在加载网络资源...
--------------------
输入钉钉机器人Access Token[如不配置直接回车即可]:# 此处如不配置,就没有通知功能
输入钉钉机器人Secret Key[如不配置直接回车即可]:# 此处如不配置,就没有通知功能
--------------------
输入扫描间隔时间[以秒为单位,默认为15秒,如不配置直接回车即可]:30 # 不建议太短,以免扫描过于频繁导致IP被封
扫描配置已生成,并已写入到apple_store_monitor_configs.json文件中
请使用 python monitor.py start 命令启动监控

配置完成后,会在当前目录下生成一个apple_store_monitor_configs.json文件:

{
  "selected_products": {
    "MGYJ3CH/A": [
      "AirPods Max",
      "AirPods Max - \u94f6\u8272"
    ],
    "MLHG3CH/A": [
      "iPhone 13 Pro Max",
      "512GB \u8fdc\u5cf0\u84dd\u8272"
    ]
  },
  "selected_area": "\u4e0a\u6d77 \u4e0a\u6d77 \u9ec4\u6d66\u533a",
  "dingtalk_configs": {
    "access_token": "",
    "secret_key": ""
  },
  "scan_interval": 30
}

如果你明白每项的意思,也可以手动填写该JSON文件,不过一定要按照上面例子中的层级,尤其是selected_products部分。

另外欢迎各位补充本项目的products.json文件,添加更多产品信息。

启动监控

接下来只需要用下面的命令启动监控即可:

比如前台启动:

$> python monitor.py start

或者后台启动:

$> nohup python -u monitor.py start > monitor.log 2>&1 &

通知效果

4种情况会通知:

  1. 启动时通知,以确认相关信息是否正确,启动是否成功。
  2. 扫描到有货源时会通知。
  3. 每天6:00 ~ 23:00整点报时,以确保程序还正常运行。
  4. 程序异常时会通知,如不是致命异常,不用理会。

相关通知截图:

NotificationExample.png

Owner
Lennon Chin
Lennon Chin
An example of using discordpy 2.0.0a to create a bot that supports slash commands

DpySlashBotExample An example of using discordpy 2.0.0a to create a bot that supports slash commands. This is not a fully complete bot, just an exampl

7 Oct 17, 2022
Rotten Tomatoes API for Python

rottentomatoes.py rottentomatoes offers an easy-to-use Python wrapper to interact with the Rotten Tomatoes API. Before you try and use the API, make s

Zach Williams 88 Dec 15, 2022
An advanced Filter Bot with nearly unlimitted filters!

Unlimited Filter Bot ㅤㅤㅤㅤㅤㅤㅤ ㅤㅤㅤㅤㅤㅤㅤ An advanced Filter Bot with nearly unlimitted filters! Features Nearly unlimited filters Supports all type of fil

1 Nov 20, 2021
A python library for creating Slack slash commands using AWS Lambda Functions

slashbot Slashbot makes it easy to create slash commands using AWS Lambda functions. These can be handy for creating a secure way to execute automated

Eric Brassell 17 Oct 21, 2022
A working bypass for discord gc spamming

IllusionGcSpammer A working bypass for discord gc spamming Installation Run pip install pip install DiscordGcSpammer then your good to go. Usage You c

6 Sep 30, 2022
Rocks vc Userbot: A Telegram Bot Project That's Allow You To Play Audio And Video Music On Telegram Voice Chat Group

⭐️ Rocks VC Userbot ⭐️ Telegram Userbot To Play Audio And Video Song On VC Chat

Dr Asad Ali 10 Jul 18, 2022
A python script for hitting the kik API to enumerate people based on a username/userlist

kick3d Recon script for enumerating users off of the Kik API. This script has the ability to check single usernames or run through a userlist of usern

Sakura Samurai 19 Oct 04, 2021
Temperature Monitoring and Prediction Using a Modified Lambda Architecture

Temperature Monitoring and Prediction Using a Modified Lambda Architecture A more detailed write up can be seen in this paper. Original Lambda Archite

Parsa Yousefi 2 Jun 27, 2022
A zero-dependency Python library for getting the Kubernetes token of a AWS EKS cluster

tokeks A zero-dependency Python library for getting the Kubernetes token of a AWS EKS cluster. No AWS CLI, third-party client or library (boto3, botoc

Chris Karageorgiou Kaneen 6 Nov 04, 2022
A discord bot that can detect Nitro Scam Links and delete them to protect other users

A discord bot that can detect Nitro Scam Links and delete them to protect other users. Add it to your server from here.

Kanak Mittal 9 Oct 20, 2022
Automatically render tens of thousands of unique NFT images individually as png's.

Blend_My_NFTs Description This project is a work in progress (as of Oct 24th, 2021) and will eventually be an add on to Blender. Blend_My_NFTs is bing

Torrin Leonard 894 Dec 29, 2022
TG-Url-Uploader-Bot - Telegram RoBot to Upload Links

MW-URL-Uploader Bot Telegram RoBot to Upload Links. Features: 👉 Only Auth Users

Aadhi 3 Jun 27, 2022
Copier template for solving Advent of Code puzzles with Python

Advent of Code Python Template for Copier This template creates scaffolding for one day of Advent of Code. It includes tests and can download your per

Geir Arne Hjelle 6 Dec 25, 2022
A GUI Weather Application written with Python

weather-box - A GUI Weather Application written with Python Made with ❤️ by Suresh Mishra

Suresh Mishra 2 Dec 18, 2021
Tiktok-bot - A tiktok bot with python

Install the requirements pip install selenium pip install pyfiglet==0.7.5 How ca

Ukis 5 Aug 23, 2022
A discord bot for checking what linked profiles a user has to their Ubisoft account

ubisoft_discord_profiles A Discord bot for checking what linked profiles a user has to their Ubisoft account. This can be setup using an enviromental

Andrei 1 Dec 17, 2021
A command line interface for accessing google drive

Drive Cli Get the ability to access Google Drive without leaving your terminal. Inspiration Google Drive has become a vital part of our day to day lif

Chirag Shetty 538 Dec 12, 2022
A Flask inspired, decorator based API wrapper for Python-Slack.

A Flask inspired, decorator based API wrapper for Python-Slack. About Tangerine is a lightweight Slackbot framework that abstracts away all the boiler

Nick Ficano 149 Jun 30, 2022
Template to create a telegram bot in python

Template for Telegram Bot Template to create a telegram bot in python. How to Run Set your telegram bot token as environment variable TELEGRAM_BOT_TOK

Ali Hejazizo 12 Aug 14, 2022
List of twitch bots n bigots

This is a collection of bot account names NamelistMASTER contains all the names we reccomend you ban in your channel Sometimes people get on that list

62 Sep 05, 2021