Skip to content

Monitor product's price & stock status. Send email when price is down or stock status is changed.

License

Notifications You must be signed in to change notification settings

thundermiracle/costco-monitor

Repository files navigation

costco-monitor

コストコオンラインに商品の価格と在庫状況をモニタリングし、変動(値下げ)、在庫ステータスが変わったらメールで知らせるシステム。

環境変数の設定

.env.sample.envにリネームし、中のパラメータを全部設定してください。

CostcoUser → コストコオンラインのログインメールアドレス
CostcoPass → コストコオンラインのログインパスワード
MailService → メール送信用のサービス(デフォルトGmail)
MailUser → メールアドレス
MailPassword → パスワード
MailTo → 宛先のメールアドレス
Urls → 監視商品のリンクリスト(JSON)

メールの2段階認証(2FA)が有効になった場合の設定方法について、下記の記事ご参考ください。

https://thundermiracle.com/blog/2020-06-13-smtp-gmail-by-nodemailer/#gmail%E3%81%AE%E8%A8%AD%E5%AE%9A

開発モード

yarn && yarn dev

製品版モード

yarn build
node ./dist/index.js

Ubuntu で動かす

  1. 必要なパッケージをインストール

    apt install -y gconf-service libasound2 libatk1.0-0 libatk-bridge2.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 ca-certificates fonts-liberation libappindicator1 libnss3 lsb-release xdg-utils wget
  2. --no-sandbox の指定

    .envに、NO_SANDBOX=trueを追加

    ※非推奨、正しい対策はこちら:https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md#setting-up-chrome-linux-sandbox

License

This project is licensed under the terms of the MIT license.

About

Monitor product's price & stock status. Send email when price is down or stock status is changed.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages