Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/qwqcode/apple-inventory-bot
https://github.com/qwqcode/apple-inventory-bot
Last synced: 3 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/qwqcode/apple-inventory-bot
- Owner: qwqcode
- Created: 2023-03-30T05:13:38.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-03-30T05:49:30.000Z (over 1 year ago)
- Last Synced: 2024-05-28T16:05:01.366Z (6 months ago)
- Language: Go
- Size: 5.86 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Apple Store Refurbished Machine Inventory Monitor Bot
https://www.apple.com.cn/shop/refurbished/mac/2021-macbook-pro
## Feature
- Lark notification
- Docker deployment
- No deps and minimal## Deploy
Docker Compose to deploy.
First, clone the code base:
```sh
git clone https://github.com/qwqcode/apple-inventory-bot.git
```Use the Docker compose to build container image:
```sh
docker compose build
```Copy the `.env.example` file to `.env`, and edit it by your preference.
```sh
cp .env.example .envvim .env
```Please notice the meaning of the env variables:
|Key|Description|Details|
|-|-|-|
|COOKIES|The COOKIE when launching a request|key-value pairs format. |
|LARK|The lark notification webhook URL| URL start with `https://open.feishu.cn/open-apis/bot/v2/hook/`. |
|KEYWORDS|The keywords of MODEL TITLE for each inventory available check|use `,` to split the multiple keywords, leave empty to omit.|
|MEM|The memory size for each inventory available check|e.g. `"32gb"`. (leave empty to omit) |
|DISK|The disk size for each inventory available check|e.g. `"512gb"`. (leave empty to omit) |
|LIST_URL|The request url of the list page in Apple Store|default is `https://www.apple.com.cn/shop/refurbished/mac/2021-macbook-pro`|Launch docker container and let it run in background:
```sh
docker compose up -d
```Some commands may help:
```sh
docker compose ps
docker compose logs
```## App lifecycle
An inventory check will be performed every Minute.
Notice that the app will be EXIT automatically while the specific product model is fetched and send the Lark notification. So, if you find the docker container is down, it proven that the model you want is available.
If you do want to prevent exit the app, you could modify the `docker-compose.yml` file and add `restart: always`. But this may cause send lark notification duplicately.
## LICENSE
MIT