Ruten-RSS-Bot

A Line bot based on a finite state machine

Setup

Prerequisite

  • Python 3.6
  • Pipenv
  • Facebook Page and App
  • HTTPS Server

Install Dependency

pip3 install pipenv

pipenv --three

pipenv install

pipenv shell

Secret Data

You should generate a .env file to set Environment Variables refer to our .env.sample. LINE_CHANNEL_SECRET and LINE_CHANNEL_ACCESS_TOKEN MUST be set to proper values. Otherwise, you might not be able to run your code.

Run Locally

You can either setup https server or using ngrok as a proxy.

a. Ngrok installation

or you can use Homebrew (MAC)

brew cask install ngrok

ngrok would be used in the following instruction

ngrok http 8000

After that, ngrok would generate a https URL.

Run the sever

python3 app.py

b. Servo

Or You can use servo to expose local servers to the internet.

Finite State Machine

fsm

Usage

可以即時查詢露天,並且不會看到什麼海外或是樂天的奇怪商品 也可以在程式碼內自訂 routine 並且快速搜尋商品

一開始可以使用兩個指令

  • routine: 查自訂的 routine

  • query: 啟動查詢模式,啟動後可以輸入多筆查詢,查詢需要時間,在查詢中無法再進行查詢,會提示等待 輸入 exit 可以離開 query state