Giter VIP home page Giter VIP logo

gearbest-prices's Introduction

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

gearbest-prices's People

Contributors

hjelev avatar pavelzamyatin avatar

Stargazers

 avatar

Watchers

 avatar  avatar

gearbest-prices's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.