Project

mochizuki

0.0
No commit activity in last 3 years
No release in over 3 years
Get the amount of electricity remaining for dorms, Tongji University
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 5.14.1
~> 13.0.1

Runtime

~> 1.0.1
~> 1.10.10
 Project Readme

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