mirror of
https://github.com/Giu-zhao/ios_rule_script
synced 2024-11-24 09:28:26 +08:00
[Apple Store] 支持iPhone 14 系列库存监控
This commit is contained in:
parent
d93b640a4b
commit
548e6802cf
@ -1,10 +1,10 @@
|
||||
|
||||
|
||||
# Apple Store 库存监控
|
||||
# 🧸 Apple Store 库存监控
|
||||
|
||||
## 前言
|
||||
|
||||
脚本用来监控线下AppleStore指定商品库存,目前验证过iPhone13、AppleWatch7系列。
|
||||
脚本用来监控线下AppleStore指定商品库存,已经支持iPhone14全系列。
|
||||
|
||||
长话短说,需要做一些准备:
|
||||
|
||||
@ -16,25 +16,88 @@
|
||||
|
||||
### 确认型号
|
||||
|
||||
iPhone13
|
||||
##### iPhone 14 系列
|
||||
|
||||
https://www.apple.com.cn/shop/buy-iphone/iphone-13/MLDH3CH/A
|
||||
https://www.apple.com.cn/shop/buy-iphone/iphone-14
|
||||
|
||||
iPhone 13 Pro
|
||||
##### iPhone 14 Pro 系列
|
||||
|
||||
https://www.apple.com.cn/shop/buy-iphone/iphone-13-pro/MLTE3CH/A
|
||||
https://www.apple.com.cn/shop/buy-iphone/iphone-14-pro
|
||||
|
||||
在上面的链接中选择需要的型号、颜色、容量,然后把地址中类似MLDH3CH/A的文本复制下来,就是需要监控的型号
|
||||
在上面的链接中选择需要的型号、颜色、容量,然后把浏览器地址中类似 `MLDH3CH/A` 的文本复制下来,就是需要监控的型号。
|
||||
|
||||
AppleWatch
|
||||
如下图:
|
||||
|
||||
https://www.apple.com.cn/shop/buy-watch/apple-watch/45mm-cellular-graphite-stainless-steel-pride-edition-braided-solo-loop-size-5
|
||||
![](https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/script/applestore/images/01.png)
|
||||
|
||||
AppleWatch因为有选项,所以会稍微麻烦,需要在浏览器的“开发人员工具”中,找到“网络”,在“筛选器”中输入`https://www.apple.com.cn/shop/fulfillment-messages`,找到网络请求,将`parts.0=xxxxx`和`option.0=xxxxxxxxxxx`中xxxxx部分复制出来保存。
|
||||
##### Apple Watch 系列
|
||||
|
||||
将两个拼接在一起,如 `Z0YQ#MKMR3CH/A,MJXA3FE/A`,就是需要监控的型号。
|
||||
<u>Apple Watch 因为有选项,所以会稍微麻烦,请以下步骤操作:</u>
|
||||
|
||||
AppleWatch目前没办法自动获取标题,所以可以自定义标题,如`Z0YQ#MKMR3CH/A,MJXA3FE/A#AppleWatch 7 石墨色不锈钢`,把这部分输入到BoxJs的监控型号中。
|
||||
1. 在浏览器中选择你所需的型号,得到类似 `https://www.apple.com.cn/shop/buy-watch/apple-watch-ultra/49mm-cellular-titanium-black-gray-trail-loop-m-l` 的地址。
|
||||
2. 在浏览器中按下`F12`,打开“开发人员工具”,在顶部的标签中选择“网络”或“network”。
|
||||
3. 在一堆网络请求中找到类似 `fulfillment-messages` 的地址,如果没有找到,保持“开发人员工具”打开的情况下,再刷新一次页面。
|
||||
4. 把含有 `https://www.apple.com.cn/shop/fulfillment-messages` 的链接复制下来,里面有我们需要的信息。
|
||||
|
||||
> 如果你对上述步骤感到比较疑惑,建议在搜索引擎中以“`Chrome 开发人员 工具 教程`”为关键词,搜索相关资料。如何查看浏览器的网络请求,并不在本项目的说明范围内。
|
||||
|
||||
###### Apple Watch Ultra
|
||||
|
||||
如果你需要监控的是Apple Watch Ultra,事情就很简单,把链接中类似parts.0=MNHT3CH/A的内容记录下来,`MNHT3CH/A`就是你需要监控的型号,保存好它!
|
||||
|
||||
###### Apple Watch 8
|
||||
|
||||
Apple Watch 8 中地址存在类似的格式 `parts.0=Z0YQ&option.0=MNNQ3CH/A,MPLE3FE/A` 。我们需要的是`parts.0` 和 `option.0` 之后的数据。
|
||||
|
||||
以上面的地址为例,我们需要的是 `Z0YQ` 和 `MNNQ3CH/A,MPLE3FE/A`。
|
||||
|
||||
至此,完成所需监控的iPhone或Apple Watch型号收集。
|
||||
|
||||
### 型号拼接
|
||||
|
||||
这步是把获取的型号,拼接成字符串,填写到BoxJS中,让脚本知道你要监控什么商品的库存。
|
||||
|
||||
#### iPhone 14、iPhone 14 Pro
|
||||
|
||||
采用如下格式
|
||||
|
||||
```
|
||||
<型号>##<名称>
|
||||
```
|
||||
|
||||
型号就是获取的设备型号,名称可以自己取,便于在通知中识别。
|
||||
|
||||
假设上面获取的型号是MLDH3CH/A,那拼接后的字符串就是
|
||||
|
||||
```
|
||||
MLDH3CH/A##小黑紫
|
||||
```
|
||||
|
||||
注意有两个##
|
||||
|
||||
#### Apple Watch
|
||||
|
||||
##### Apple Watch Ultra
|
||||
|
||||
和iPhone相似
|
||||
|
||||
```
|
||||
MNHT3CH/A##Apple Watch Ultra
|
||||
```
|
||||
|
||||
##### Apple Watch 8
|
||||
|
||||
```
|
||||
Z0YQ#MNNQ3CH/A,MPLE3FE/A#Apple Watch 8
|
||||
```
|
||||
|
||||
#### 多个型号
|
||||
|
||||
如下拼接
|
||||
|
||||
```
|
||||
MLDH3CH/A##小黑紫;MNHT3CH/A##Apple Watch Ultra;Z0YQ#MNNQ3CH/A,MPLE3FE/A#Apple Watch 8
|
||||
```
|
||||
|
||||
### 确认地区
|
||||
|
||||
@ -42,11 +105,19 @@ AppleWatch目前没办法自动获取标题,所以可以自定义标题,如`
|
||||
|
||||
直辖市示例:北京 北京 昌平区
|
||||
|
||||
如果搞不定的话,在Apple官网选择查看取货情况,把下面的字保存下来,每个间隔一个空格。
|
||||
|
||||
![](https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/script/applestore/images/03.png)
|
||||
|
||||
## BoxJS填写效果
|
||||
|
||||
![](https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/script/applestore/images/04.png)
|
||||
|
||||
## 进阶问题
|
||||
|
||||
### 脏数据
|
||||
|
||||
每次配置型号和地区,都必须在BoxJS中把`iphone_stock`的值清理掉,避免脏数据导致脚本异常。
|
||||
每次配置型号和地区,都必须在BoxJS中把库存的数据清理掉,避免脏数据导致脚本异常。
|
||||
|
||||
### 监控间隔
|
||||
|
||||
@ -81,7 +152,7 @@ AppleWatch目前没办法自动获取标题,所以可以自定义标题,如`
|
||||
使用模块
|
||||
|
||||
```ini
|
||||
https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/script/applestore/iphone.sgmodule
|
||||
https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/script/applestore/applestore.sgmodule
|
||||
```
|
||||
|
||||
### Loon
|
||||
@ -89,7 +160,7 @@ https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/script/app
|
||||
使用插件
|
||||
|
||||
```ini
|
||||
https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/script/applestore/iphone.lnplugin
|
||||
https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/script/applestore/applestore.lnplugin
|
||||
```
|
||||
|
||||
### Quantumult X
|
||||
@ -98,6 +169,21 @@ https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/script/app
|
||||
|
||||
```ini
|
||||
[task_local]
|
||||
0/5 * 6-23 * * * https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/script/applestore/iphone.js, tag=AppleStore_商品库存监控, enabled=true
|
||||
0/5 * 6-23 * * * https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/script/applestore/applestore.js, tag=AppleStore_商品库存监控, enabled=true
|
||||
```
|
||||
|
||||
## 变量说明
|
||||
|
||||
NodeJS(含青龙面板),请根据下表配置magic.json的变量。
|
||||
|
||||
更新详细的配置说明,请访问:https://github.com/blackmatrix7/ios_rule_script/blob/master/script/README.md。
|
||||
|
||||
| 变量 | 类型 | 说明 |
|
||||
| ---------------------------------- | ------ | ------------------------------------------------------------ |
|
||||
| applestore_goods_model | string | 监控的商品型号,类似`MPU93CH/A##iPhone 14 午夜色 128G` 。 |
|
||||
| applestore_region | string | 监控的地区,类似`北京 北京 昌平区`、`吉林 长春 朝阳区` 。 |
|
||||
| applestore_settings_notify_soldout | bool | 售罄也进行推送,建议为`false` 。 |
|
||||
| applestore_run_forever | bool | NodeJS环境下只运行一次或无限次运行。只运行一次适合在青龙面板设置定时任务;无限运行适合用NodeJS直接启动脚本。 |
|
||||
| applestore_watch_interval | number | NodeJS无限运行时,库存监控间隔,单位毫秒,最小2000。 |
|
||||
| applestore_goods_stock | json | 监控的库存数据,自动生成,不要修改。 |
|
||||
|
||||
|
File diff suppressed because one or more lines are too long
10
script/applestore/applestore.lnplugin
Normal file
10
script/applestore/applestore.lnplugin
Normal file
@ -0,0 +1,10 @@
|
||||
#!name= AppleStore
|
||||
#!desc= AppleStore线下库存监控
|
||||
#!openUrl= https://github.com/blackmatrix7/ios_rule_script/tree/master/script/applestore
|
||||
#!author= blackmatrix7
|
||||
#!homepage= https://github.com/blackmatrix7/ios_rule_script
|
||||
#!icon= https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/script/applestore/icon/applestore.png
|
||||
|
||||
[Script]
|
||||
cron "0/5 * 6-23 * * *" script-path=https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/script/applestore/applestore.js,timeout=5,tag=AppleStore_查询商品库存
|
||||
|
@ -1 +0,0 @@
|
||||
cron "0/5 * 6-23 * * *" script-path=https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/script/applestore/applestore.js,timeout=5,tag=AppleStore_查询商品库存
|
BIN
script/applestore/images/01.png
Normal file
BIN
script/applestore/images/01.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 21 KiB |
BIN
script/applestore/images/02.png
Normal file
BIN
script/applestore/images/02.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 51 KiB |
BIN
script/applestore/images/03.png
Normal file
BIN
script/applestore/images/03.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 84 KiB |
BIN
script/applestore/images/04..jpg
Normal file
BIN
script/applestore/images/04..jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 95 KiB |
BIN
script/applestore/images/04.png
Normal file
BIN
script/applestore/images/04.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 69 KiB |
Loading…
Reference in New Issue
Block a user