noginn / garmin-connect-client
A simple PHP library to interact with the Garmin Connect website and APIs
dev-master
2013-03-07 19:22 UTC
Requires
- php: >=5.3.2
- kriswallsmith/buzz: >=0.7
This package is not auto-updated.
Last update: 2024-11-09 14:47:49 UTC
README
Provides a simple PHP library to interact with the Garmin Connect website and APIs.
Usage
Export the 25 most recent activities
<?php use Buzz\Browser; use Buzz\Client\Curl; use Endurance\GarminConnect\GarminConnectClient; $username = 'test'; $password = 'qwerty'; $browser = new Browser(new Curl()) $client = new GarminConnectClient($browser); $client->signIn($username, $password); $activities = $client->fetchActivities($username, 25); foreach ($activities as $activity) { $client->downloadActivity($activity->getId(), __DIR__ . '/activities/' . $activity->getId() . '.tcx'); }
Upload an activity FIT file
<?php use Buzz\Browser; use Buzz\Client\Curl; use Endurance\GarminConnect\GarminConnectClient; $username = 'test'; $password = 'qwerty'; $browser = new Browser(new Curl()); $client = new GarminConnectClient($browser); $client->signIn($username, $password); $client->uploadActivity('/path/to/activity.fit');
Running the export script
$ cd garmin-connect-client
$ php composer.phar install
$ ./bin/export username password [/path/to/save/files]