Price and availability tracker for gearbest.com
There are two ways of using this script - running on your machine in virtual environment or in Docker container. Choose which one you'd prefer more and follow the instrtuctions below.
No matter what you've choosen adjust those settings to suit your preferences:
- Update url_list in ./app.py:
url_list = [
# your items here
]
- Update app's settings in ./config.ini
period = 360
currency = NZD
rate = 1.46
You can also adjuct other settings to your needs.
- Make sure that you're using right version of python in your venv:
virtualenv -p python3 .venv
source .venv/bin/activate
pip install -r requirements.txt
- Set up ENVs:
export SMTP_USER = <[email protected]>
export SMTP_PASS = <password>
export SMTP_FROM = <[email protected]>
export SMTP_TO = <your_email_address>
- Run the script:
./app.py
- Create .env file in app's main directory and populate it with those variables:
DOCKER_NAME=<name_for_docker>
SMTP_USER=<[email protected]>
SMTP_PASS=<password>
SMTP_FROM=<[email protected]>
SMTP_TO=<your_email_address>
- Build the image by running
make build
- Run the container
make local
- Check that everything is working
docker ps
docker logs -f <name_for_docker>
2018-06-29 09:50:25,816 - tracker.price_check - INFO - ************** [ITEM] **************
2018-06-29 09:50:25,817 - tracker.price_check - INFO - Name: Xiaomi Redmi Note 5 4G Phablet Global Version - $229.99 Free~
2018-06-29 09:50:25,817 - tracker.price_check - INFO - URL: https://www.gearbest.com/cell-phones/pp_1660531.html
2018-06-29 09:50:25,817 - tracker.price_check - INFO - New price: $335.79NZD / Old price: $0.0NZD
2018-06-29 09:50:25,817 - tracker.price_check - INFO - Stock: Availability changed to 'In stock'!
2018-06-29 09:50:25,817 - tracker.price_check - INFO - Sending an email. Please wait a second...
2018-06-29 09:50:30,451 - tracker.price_check - INFO - Email has been sent.
2018-06-29 09:50:30,452 - __main__ - INFO - Sleep for 60 seconds...
from: ******@gmail.com
to: ******@gmail.com
Product: Xiaomi Redmi Note 5 4G Phablet Global Version - $229.99 Free
Price: New price - $335.79. The price has raised to $335.79
Availability: In stock
Link: https://www.gearbest.com/cell-phones/pp_1660531.html