In Taiwan, the latest iPhone usually solded out after Apple Event. If you don't order iPhone at the first time, you need to wait it after a month. However, Apple will update the status of availability. We want to know whether iPhone in stock through code with crontab. We will receive a LINE message if iPhone is available.
-
Add ChromeDriver into Project Folder
- Go to https://chromedriver.chromium.org/
- Download ChromeDriver with relative version
-
Obtain LINE Token
- Log in https://notify-bot.line.me/zh_TW/
- click personal page
- click generate token
- paste your token into
config.ini
-
Modify Absolute Path
- modify absolute path for
config_pathandchromedriver_pathinwhere_is_my_iPhone.py - modify absolute path of
pythonandwhere_is_my_iPhone.pyinrun.sh
- modify absolute path for
-
Add
run.shto crontab- command
crontab -e - add new schedule using
*/1 * * * * bash /Users/hau/Documents/Python/iPhone_in_Stock/run.sh - do the bash at every minute
- command