diff --git a/README.md b/README.md index fc7ddc8..d599469 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,33 @@ # aliexpress-price-tracker +Price tracker for aliexpress. + +A file containing aliexpress login token cookies has to be provided in /app/cookies.json (obtained with cookie-quick-manager https://github.com/ysard/cookie-quick-manager/) for accurate prices (no "welcome discount"). + +## how to use (with podman) +### build +``` +podman build --tag alipricetrack:1.0.0 -f ./Dockerfile +podman build --tag alipricetrack_cron:1.0.0 -f ./CronDockerfile +``` + +### run +``` +podman pod create --name aliexpress -p 8080:8080 + +podman run -d --pod=aliexpress -e POSTGRES_DB="aliexpress" -e POSTGRES_USER="postgres" -e POSTGRES_PASSWORD="postgres" -v /home/data/podman/aliexpress/db:/var/lib/postgresql/data:Z --name ali-db docker.io/postgres + +podman run -d --pod=aliexpress -e POSTGRES_DB="aliexpress" -e POSTGRES_USER="postgres" -e POSTGRES_PASSWORD="postgres" -v /home/data/podman/aliexpress/cookies.json:/app/cookies.json:Z --name ali-app alipricetrack:1.0.0 + +podman run -d --pod=aliexpress -e WAIT_TIME="1d" --name ali-cron alipricetrack_cron:1.0.0 +``` + +WAIT_TIME is the time to wait between each database refresh, it can be in: + ++ s : seconds ++ m : minutes ++ h : hours ++ d : days + +If not specified, default wait time is 1 day.

+For reverse proxy configuration see `example-nginx.conf` diff --git a/src/aliexpress.py b/src/aliexpress.py index 6281c07..b395e60 100644 --- a/src/aliexpress.py +++ b/src/aliexpress.py @@ -22,7 +22,6 @@ def load_cookies_from_file(file_path): def check_item(settings_item): ''' return a dict with items data extracted from aliexpress. - a file containing aliexpress login token cookies has to be provided in ./cookies.json (obtained with cookie-quick-manager https://github.com/ysard/cookie-quick-manager/) for accurate prices (no "welcome discount") extracted data: skuId, quantity, discount_percentage, price, currency, choice_delivery, image parameter settings_item is a list of tables (string(itemid), attributes)