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
BingBot - A bot that will automate searches on bing

bingBot A bot that will automate searches on bing. To install this just download

Lukas 2 Jul 28, 2022
A multipurpose Telegram Bot writen in Python for mirroring files

Deepak Clouds Mirror Deepak Clouds Torrent is a multipurpose Telegram Bot writen in Python for mirroring files on the Internet to our beloved Google D

MR.SHAGGY 0 Dec 19, 2021
Discord.py Bot Series With Python

Discord.py Bot Series YouTube Playlist: https://www.youtube.com/playlist?list=PL9nZZVP3OGOAx2S75YdBkrIbVpiSL5oc5 Installation pip install -r requireme

Step 1 Dec 17, 2021
This bot will automatically like and follow users that post under a specified hashtag

Instagram-bot This bot will automatically like and follow users that post under a specified hashtag Dependencies Java JDK Selenium Updated version of

Makana Edwards 1 Nov 04, 2021
Example of Telegram local API and aiogram 3.x

Telegram Local Full example of Telegram local application. Contains Telegram Bot API Local Telegram Bot API server based on aiogram Bot API Server ima

Oleg A. 9 Sep 16, 2022
Termux Pkg

PKG Install Termux All Basic Pkg. Installation : pkg update && pkg upgrade && pkg install python && pkg install python2 && pkg install git && git clon

ɴᴏʙɪᴛᴀシ︎ 1 Oct 28, 2021
Emo-Fun is a bot which emojifies the text you send it

About Emo-Fun is a bot which emojifies the text you send it. It is easier to understand by an example Input : Hey this is to show my working!! Output

Suvodeep Sinha 3 Sep 30, 2022
Messing around with GitHub API to look at omicron build times

gh-workflow-runs This is a very simple tool to dump out basic information about workflow runs for a GitHub repo. The structure is based on gh-subscrip

David Pacheco 1 Nov 30, 2021
Stream Telegram files to web

Telegram File Stream Bot A Telegram bot to stream files to web Demo Bot » Report a Bug | Request Feature Table of Contents About this Bot Original Rep

Wrench 572 Jan 09, 2023
A delightful and complete interface to GitHub's amazing API

ghapi A delightful and complete interface to GitHub's amazing API ghapi provides 100% always-updated coverage of the entire GitHub API. Because we aut

fast.ai 428 Jan 08, 2023
A heraldry-related bot, designed for the Heraldry Community.

Heraldtron A heraldry-related bot, designed for the Heraldry Community. Requirements Python 3.9+ discord.py aiohttp (comes installed with discord.py)

1 Mar 31, 2022
Forward Propagation, Backward Regression and Pose Association for Hand Tracking in the Wild (CVPR 2022)

HandLer This repository contains the code and data for the following paper: Forward Propagation, Backward Regression, and Pose Association for Hand Tr

<a href=[email protected]"> 17 Oct 02, 2022
A Slack bot for playing Texas Hold 'Em where the currency is various workout tasks e.g. pushups

A Slack app/bot for playing Texas Hold 'Em where the currency is various workout tasks e.g. pushups. The intent is to make the workday more fun & active for remote teams.

Kyle McIntyre 3 Sep 19, 2022
Get Notified about vaccine availability in your location on email & sms ✉️! Vaccinator Octocat tracks & sends personalised vaccine info everday. Go get your shot ! 💉

Vaccinater Get Notified about vaccine availability in your location on email & sms ✉️ ! Vaccinator Octocat tracks & sends personalised vaccine info ev

Mayukh Pankaj 6 Apr 28, 2022
Slam Mirror Bot is a multipurpose Telegram Bot written in Python for mirroring files on the Internet to our beloved Google Drive.

Slam Mirror Bot is a multipurpose Telegram Bot written in Python for mirroring files on the Internet to our beloved Google Drive.

Abinash939 1 Oct 10, 2021
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
Desafio de projeto sobre Git/Github

Maçã ou Laranja? 🤔 Desafio Projeto Dio para Git/Github 🔶 Para esse primeiro repositório, decidir adicionar o primeiro algoritmo de inteligência arti

José Filipe 2 Oct 23, 2022
The implementation of Learning Instance and Task-Aware Dynamic Kernels for Few Shot Learning

INSTA: Learning Instance and Task-Aware Dynamic Kernels for Few Shot Learning This repository provides the implementation and demo of Learning Instanc

11 Jan 02, 2023
This repo contains a small project i've done using PILLOW module in python

This repo contains a small project i've done using PILLOW module in python. I wrote an automated script which generates more than 5k+ unique nfts with 0 hassle in less time.

SasiVatsal 11 Nov 05, 2022
A multi-tenant multi-client scalable product categorising demo stack

Better Categories 4All: A multi-tenant multi-client product categorising stack The steps to reproduce training and inference are in the end of this fi

7 Feb 15, 2022