/New-Taipei-City-Traffic-Adjudication-Office-Bot

A bot to help you get case status and send to line chat from New Taipei City Traffic Adjudication Office.

Primary LanguagePython

New Taipei City Traffic Adjudication Office Bot

A bot to help you get case status and send to line chat from New Taipei City Traffic Adjudication Office.

Docker Image CI

run from source

docker run -d --name=selenium-hub --rm -p 4444:4444 -v /dev/shm:/dev/shm selenium/standalone-chrome:4.2.0

pyenv activate ntpc_tad_bot
export PYTHONPATH=`pwd`:$PYTHONPATH
CASE_ID= \
ACDT_DATE= \
LINE_TOKEN= \
CHROME_REMOTE_URL=http://selenium-hub:4444/wd/hub \
python3 ntpc_tad_bot/__main__.py

docker-compose

Build ntpc_tad_bot docker image

./scripts/build.sh

Create a .env file by referring to the example below

Refer to .env.sample to write environment variables

CASE_ID=
ACDT_DATE=1110912
LINE_TOKEN=
CHROME_REMOTE_URL=http://selenium-hub:4444/wd/hub
FINAL_SCREEN_PATH=/final_screen

If you have not adjusted the container name and binding port, you do not need to adjust CHROME_REMOTE_URL

Create and start containers

docker-compose up -d

Stop and remove containers, networks

docker-compose down

reference

chromium driver

TODO

  • crontab