Co-authored-by: Smaug123 <3138005+Smaug123@users.noreply.github.com> Reviewed-on: #20
Unofficial PureGym client
With thanks to Tom Hollingsworth.
Usage
- With Nix:
nix run
(you can refer to this flake). - Manually:
git clone
and thendotnet run --project PureGym.App/PureGym.App.fsproj
.
(Something is up on Darwin: nix run
currently produces an executable which dies instantly.
Workaround: nix build
and then nix develop --command dotnet exec ./result/lib/puregym/PureGym.App.dll
.)
The available subcommands can be viewed in the subcommands
map defined in Program.fs.
As of this writing, the following are implemented:
activity
: get the logged-in user's activity stats. I have no idea what the semantics of these numbers are!fullness
: determine how full a given gym is right now.lookup-gym
: give information about the gym's physical instantiation (e.g. its address).
Authentication
You can authenticate with your PureGym email address and PIN combination, or (probably better) you can call PureGym.App auth
to obtain a token.
Use this token in subsequent commands by setting the PUREGYM_BEARER_TOKEN
environment variable or supplying it as --bearer-token
.
Structure
- The REST client is at Api.fs.
- The standalone application is at PureGym.App. It uses a ghastly mix of hand-rolled argument parsing and Argu, because Argu does not quite want to do what I want an argument parser to do.
Languages
F#
97.1%
Nix
2.9%