NAME

WebService::Strava::Auth - A Strava Segment Object

VERSION

version 0.06

SYNOPSIS

my $auth = WebService::Strava::Auth->new(
  ['config_file' => '/path/to/file'], 
  ['scope' => 'read']
);

DESCRIPTION

A thin wrapper around LWP::Authen::OAuth2 to provide a pre-authenticated Oauth2 object
as a helper for the rest of WebService::Strava.

METHODS

setup()

$auth->setup();

Runs through configuring Oauth2 authentication with the Strava API. You will need your client_id and client_secret available here:

https://www.strava.com/settings/api

get_api

$strava->auth->get_api($url);

Mainly used for an internal shortcut, but will return a parsed perl data structure of what the api returns.

delete_api

$strava->auth->delete_api($url);

Mainly used for an internal shortcut, but will return true on success or false on failure.

post_api

$strava->auth->post_api($url,$content);

Mainly used for an internal shortcut, but will return a parsed perl data structure of what the api returns. '$content' is expected to be a plain perl data structure. The method will encode it to json.

uploads_api

$strava->auth->uploads_api(file => 'sample.gpx', type => 'gpx');

Mainly used for an internal shortcut, but will return a parsed perl data structure of what the api returns.

AUTHOR

Leon Wright < techman@cpan.org >

COPYRIGHT AND LICENSE

This software is copyright (c) 2014 by Leon Wright.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.