Telegram bot that notifies you when the Apple Store in Singapore has the product you want in stock.
Important
Refer to tracking_request.json
to view the models that are currently being tracked.
Feel free to open an issue or submit a pull request to add more models to track.
Purpose/Rationale | |
---|---|
Go | Easy setup, easy to use, my grug brain like (context) |
Telegram | Go-to messaging app commonly used by Singaporeans, supports broadcast channels |
Cloud Function | Generous free tier, pay for what you use |
Cloud Scheduler | Setup cron jobs with HTTP POST |
MongoDB Atlas | Data persistence to easily track alerts sent, easy setup |
Note
For the full details, feel free to read in the devlog.
FUNCTION_NAME=apple_notifier go run cmd/localcf/main.go
# Alternatively, use the .env file
# env $(cat .env | xargs) go run cmd/localcf/main.go
FUNCTION_NAME=apple_notifier go run cmd/zipcf/main.go
# Alternatively, use the .env file
# env $(cat .env | xargs) go run cmd/zipcf/main.go
- Zip the cloud function using the command above
- Upload the zip file to the cloud function
- Set the cloud scheduler to send a HTTP POST request with the
tracking_request.json
as the body to the cloud function
You can also run your own instance of the bot to track models from other countries, though I've only managed to ensure that this works for Apple stores in Singapore and Hong Kong.
Hong Kong Apple stores example
{
"abbrev_country": "hk",
"country": "hong kong",
"models": ["MU7J3ZP/A", "MU7E3ZP/A", "MU793ZP/A"]
}
There was another Github repo I saw that did something similar but used a desktop application to notify the users that was built in Go with Fyne, I believe. I can't seem to find it anymore but I'd like to credit the author for the inspiration and providing the endpoint to query the Apple Store inventory.