Skip to content

DarkKowalski/mochizuki

Repository files navigation

Mochizuki

同济大学能源管理中心电费自动查询 telegram bot

Manually/auto query and send alarms to channel when the power gets below your threshold.

3 4

Installation

From RubyGems

gem install mochizuki

Using docker

Recommended

docker pull darkkowalski/mochizuki
docker run --name mochizuki \
           --restart=always \
           -v /path/to/mochizuki.conf:/app/mochizuki.conf \
           -d -it darkkowalski/mochizuki

Configuration

Place a mochizuki.conf in your directory and run mochizuki

Mochizuki.configure do |config|
  config.bot_token = 'your_bot_token'
  config.channel = '@your_channel'
  config.query_interval = '300s'
  config.alarm_threshold = '60' # kWh

  config.campus = '1'
  config.building = '1'
  config.floor = '1'
  config.dorm = '1'
end

How to get the last four attributes

Go to 同济大学能源管理中心 and fill the form

1

Open your dev tools and look at the bottom on the right

2

Those shitty words mean

drlouming  ->  campus
drceng     ->  building
dr_ceng    ->  floor
drfangjian ->  dorm

Known issues

Telegram returned 403

Telegram API has returned the error. (ok: "false", error_code: "403", description: "Forbidden: bot was kicked from the supergroup chat") (Telegram::Bot::Exceptions::ResponseError)

This is a telegram internal issue, not this gem's.

See Stack Overflow

About

同济大学能源管理中心电费自动查询 telegram bot

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published