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
universal messaging & notifications api

Pronounced "boat-shahft" What is botschaft? Botschaft is unified messaging & notifications appliance. Want to text yourself when a long-running task c

Tyler M. Kontra 25 Aug 16, 2022
Quack-SMS-BOMBER - Quack Toolkit By IkigaiHack

Quack Toolkit By IkigaiHack About Quack Toolkit Quack Toolkit is a set of tools

Marcel 2 Aug 19, 2022
An powerfull telegram group management anime themed bot.

ErzaScarlet Erza Scarlet is the female deuteragonist of the anime/manga series Fairy Tail. She is an S-class Mage from the Guild Fairy Tail. Like most

ꜱōʜᴇʀᴜ ᴋāɴ (AKA) ꜱᴏʜᴀɪʟ ᴋʜᴀɴ 2 May 19, 2022
A simple program to display current playing from Spotify app on your desktop

WallSpot A simple program to display current playing from Spotify app on your desktop How to Use: Linux: Currently Supports GNOME and KDE. If you want

Nannan 4 Feb 19, 2022
gnosis safe tx builder

Ape Safe: Gnosis Safe tx builder Ape Safe allows you to iteratively build complex multi-step Gnosis Safe transactions and safely preview their side ef

228 Dec 22, 2022
um simples script para localizar IP

um simples script para localizar IP pkg install git (apt-get install git) pkg install python (apt-get install python) git clone https://github.com/byd

bydeathlxncer 4 Nov 29, 2021
CSUL Discord Bot

Cruzeiro This is the same old bot running on the Discord Server of CSUL, but i've changed the code. It's better now. Discord.py Heroku How i did The b

Operaho 6 Jan 31, 2022
Evernote SDK for Python

Evernote SDK for Python Evernote API version 1.28 This SDK is intended for use with Python 2.X For Evernote's beta Python 3 SDK see https://github.com

Evernote 612 Dec 30, 2022
Satoshi is a discord bot template in python using discord.py that allow you to track some live crypto prices with your own discord bot.

Satoshi ~ DiscordCryptoBot Satoshi is a simple python discord bot using discord.py that allow you to track your favorites cryptos prices with your own

Théo 2 Sep 15, 2022
A website application running in Google app engine, deliver rss news to your kindle. generate mobi using python, multilanguages supported.

Readme of english version refers to Readme_EN.md 简介 这是一个运行在Google App Engine(GAE)上的Kindle个人推送服务应用,生成排版精美的杂志模式mobi/epub格式自动每天推送至您的Kindle或其他邮箱。 此应用目前的主要

2.6k Jan 06, 2023
Cloudkeeper is “housekeeping for clouds” - find leaky resources, manage quota limits, detect drift and clean up.

Cloudkeeper Housekeeping for Clouds! Table of contents Overview Docker based quick start Cloning this repository Component list Contact License Overvi

Some Engineering 1.2k Jan 03, 2023
Telegram bot for making Heroku app.json by @AbirHasan2005

Heroku-app.json A Telegram bot for making Heroku app.json by @AbirHasan2005. Demo Bot Host Bot Deploy to Heroku Click Below Button to Deploy to Heroku

Abir Hasan 46 Nov 13, 2022
Access Undenied parses AWS AccessDenied CloudTrail events, explains the reasons for them, and offers actionable remediation steps. Open-sourced by Ermetic.

Access Undenied on AWS Access Undenied parses AWS AccessDenied CloudTrail events, explains the reasons for them, and offers actionable fixes. Access U

Ermetic 204 Jan 02, 2023
Light weight Scripts and Apps for checking availability of Covid Vaccines in India. Notifies when vaccine becomes avialable in your area.

vaccine-checker Light weight Scripts and Apps for checking availability of Covid Vaccines in India. Notifies when vaccine becomes avialable in your ar

Abishek V Ashok 8 Jun 16, 2021
An unoffcial python API client for primeuploads.com

primeuploads-py An unoffcial python API wrapper for primeuploads.com Installation pip3 install primeuploads-py Usage example from prime import PrimeUp

W4RR10R 41 Dec 05, 2022
Discord bot do sprawdzania ceny pizzy.

Discord bot do sprawdzania ceny pizzy w pizzeri Bombola. Umieszczony jest na platformie Heroku, dzięki czemu działa 24/7. Commands List Info: Jako com

1 Sep 18, 2021
Bitbucket Server API Wrapper

A simple wrapper for the Atlassian's Bitbucket Server / Bitbucket Datacenter (formerly Stash) REST API, written in Python.

Schweitzer Engineering Laboratories 4 Jan 06, 2023
TheTimeMachine - Weaponizing WaybackUrls for Recon, BugBounties , OSINT, Sensitive Endpoints and what not

The Time Machine - Weaponizing WaybackUrls for Recon, BugBounties , OSINT, Sensi

Anmol K Sachan 112 Dec 29, 2022
A Simple Telegram Bot To Download And Upload Files

AquaDLBot ➠ I Can Download And Upload files To Telegram DEMO Copyright (C) 2020-2026 by [ema

Asia Argento 8 Feb 15, 2022
Man-Userbot adalah userbot Telegram modular yang berjalan di Python3 dengan database sqlalchemy

Man-Userbot Telegram Man-Userbot adalah userbot Telegram modular yang berjalan di Python3 dengan database sqlalchemy. Berbasis Paperplane dan ProjectB

DzLyz 1 Feb 12, 2022