Skip to content

Price and availability tracker for gearbest.com (docker + email notifications)

Notifications You must be signed in to change notification settings

pavelzamyatin/gearbest-prices

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

78 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gearbest.com products tracker

Price and availability tracker for gearbest.com


Set up

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:

  1. Update url_list in ./app.py:
url_list = [
	# your items here
]
  1. Update app's settings in ./config.ini
period = 360
currency = NZD
rate = 1.46

You can also adjuct other settings to your needs.

Running in virtual environment

  1. 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
  1. Set up ENVs:
export SMTP_USER = <[email protected]>
export SMTP_PASS = <password>
export SMTP_FROM = <[email protected]>
export SMTP_TO = <your_email_address>
  1. Run the script:
./app.py

Running in Docker

  1. 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>
  1. Build the image by running
make build
  1. Run the container
make local
  1. Check that everything is working
docker ps
docker logs -f <name_for_docker>

Script output example:

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...

Email example:

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

About

Price and availability tracker for gearbest.com (docker + email notifications)

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published