Skip to content

Just for personal use and crawler practice. Refer to GaryniL/Amazon-Price-Alert (https://github.com/GaryniL/Amazon-Price-Alert).

License

Notifications You must be signed in to change notification settings

mdes4214/in-stock-alert

Repository files navigation

InStockAlert

Just for personal use and crawler practice.
This job will send an email when the target items are in stock and out of stock.
Currently support Pokemon Center Online and Amazon JP.

Referenced from GaryniL (https://github.com/GaryniL/Amazon-Price-Alert).

Installation

Same as the reference.

$pip install -r requirements.txt

Configuration

Gmail

"email": {
        "smtp_url": "smtp.gmail.com:587",
        "sender": "SENDER_ADDRESS",
        "sender-password": "SENDER_PASSWORD",
        "receivers": ["RECEIVER_ADDRESS_1", "RECEIVER_ADDRESS_2"]
    }

Site

"sites": [
        "PokemonCenter",
        "AmazonJP"
    ]
  • sites can be set as PokemonCenter or AmazonJP in a list.

Target Items (Pokemon Center Online)

"item-to-parse": [
        "P_CD"
    ]
  • item-to-parse is a list of the Product Code, which can be found in url, e.g. ["4521329284125", "4521329320212"].

Target Items (Amazon JP)

"item-to-parse": [
        "ID"
    ]
  • item-to-parse is a list of the Item ID, which can be also found in AmazonJP's url, e.g. ["B08JYXPCD2", "B08JZ161C7", "B08JYXDBLZ"].

Interval Time

"default-internal-time":300
  • default-internal-time default is set to 300(s).
    The job will check the items about every 300 seconds.
    Note that too high frequency may make your IP be banned.

Run the job

$crawler.py

UTF-8 in CMD

Refer to 在命令提示視窗(Command Prompt)顯示UTF-8內容

$chcp 65001

Then the title of items can be showed correctly.

If the cmd shows the error LookupError: unknown encoding: cp65001, you can set the encoding of Python to UTF-8 (in the same terminal).

$set PYTHONIOENCODING=UTF-8

Refer to Python 2.7 : LookupError: unknown encoding: cp65001 - Stack Overflow

About

Just for personal use and crawler practice. Refer to GaryniL/Amazon-Price-Alert (https://github.com/GaryniL/Amazon-Price-Alert).

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages