climber-count

command module
v0.1.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 3, 2024 License: MIT Imports: 23 Imported by: 0

README

Climber Count

This is a Telegram bot that scrapes the rockgympro.com climber count gauge for a given gym and returns the latest people count to a channel when asked.

How it works

  • Periodically pulls HTML from rockgympro.com for a given pgk and fId.
  • Parses the HTML file and extracts var data as JSON.
  • Retrieves the counter for a given gym and stores it along with the update time in SQLite.
  • When the bot is asked for /count, it returns the latest count from the storage.

Installation

You can either download the binary from the release tab, use Homebrew with brew tap eiri/tap and brew install climber-count, or use Docker with docker pull ghcr.io/eiri/climber-count.

Configuration

Export the following environment variables:

PGK - A rockgympro.com UID. This is usually an MD5-like string in the URL path set right after "public".
FID - Another ID, organization-specific.
GYM - A gym abbreviation. The response can contain multiple gyms' counters.
SCHEDULE - Key=crontab pairs separated by |. For example: weekdays=4 */5 8-22 * * MON-FRI|weekends=2 */5 8-20 * * SAT,SUN. This pulls the counter every five minutes during the gym's working hours. Theoretically, it can go down to seconds, but there is no need to spam rockgympro.com. Be nice.
STORAGE - A path to the SQLite file.
BOT_TOKEN - A Telegram bot token from @BotFather.

For Docker, it is probably more convenient to use docker-compose.

Licence

MIT

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL