The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

WebService::SmartRow - Connect and get data from SmartRow API

VERSION

version 0.008

SYNOPSIS

This module is a basic wrapper to allow Perl apps to access data from https://smartrow.fit

 my $smartrow = WebService::SmartRow->new(
  username => 'foo',
  password => 'bar',
 );

 my $profile  = $smartrow->get_profile;
 my $workouts = $smartrow->get_workouts;

Credentials can be passed via environment variables

* SMARTROW_USERNAME * SMARTROW_PASSWORD

If passing credentials via ENV you can simply use WebService::SmartRow->new;

ATTRIBUTES

http

http is a HTTP::Tiny object by default, you can provide your own on construction.

This might be helpful if, for example, you wanted to change the user agent.

username

get/set the username for the API

Note that we parse the username in get_ methods to escape the "@" char.

You can also set the SMARTROW_USERNAME environment variable.

password

get/set the password for the API

You can also set the SMARTROW_PASSWORD environment variable.

METHODS

get_profile

This method obtains your profile information

get_workouts

This method returns all the workouts you have done via SmartRow

get_leaderboard

This method returns the data presented in the leaderboard (AKA Rankings page).

Unlike the first two methods, get_leaderboard can accept parameters to limit the data.

e.g. my $leaderboard = $srv->get_leaderboard( distance => 5000, # If not provided will default to 2000 year => 2022, country => 188, age => 'c', gender => 'f', # m or f (male or female) weight => 'l', # l or h (light or heavy) );

More details on values able to be used to follow.

get_challenges

This method returns an array of challenges, there are no parameters.

AUTHOR

Lance Wicks <lw@judocoach.com>

COPYRIGHT AND LICENSE

This software is Copyright (c) 2022 by Lance Wicks.

This is free software, licensed under:

  The MIT (X11) License