This repo is not maintained and the script most likely doesn't work anymore since Nike+PHP is dead., (*1)
About
NikePlusExport is a script built to help you export your Nike+ gps activities.
The script supports JSON, GPX and TCX as output formats.
This project has been mainly inspired by https://gist.github.com/3121560., (*2)
This script does NOT use the nike+ api to retrieve the activites, (*3)
Requirements
This script is based on the excellent Nike+PHP http://nikeplusphp.org/.
It has been successfully tested with nikeplusphp.4.5.php.
To run correctly, it needs PHP 5 with cURL and JSON., (*4)
Installation
Simply run, assuming you have installed composer.phar or composer binary:, (*5)
$ composer require ngpp/nikeplusexport
Examples
Here's an example of code to export all your runs:, (*6)
#!php
<?php
//Creates the object
$n = new \Nike\Export($username, $password);
foreach ($n->activities() as $activity)
{
if ($activity->gps)
{
//Activities need to be loaded one by one to get the gps data
$activity = $n->activity($activity->activityId)->activity;
//Create JSON file
if(!is_null($jsonContent = $n->toJSON($activity)))
{
file_put_contents($activity->activityId . '.json', $jsonContent);
}
//Create GPX file
if(!is_null($gpxContent = $n->toGPX($activity)))
{
file_put_contents($activity->activityId . '.gpx', $gpxContent);
}
//Create TCX file
if(!is_null($tcxContent = $n->toTCX($activity)))
{
file_put_contents($activity->activityId . '.tcx', $tcxContent);
}
}
}
The script outputs respect the following implementations:, (*7)
- GPX format: http://www.topografix.com/gpx.asp
- TCX format: http://developer.garmin.com/schemas/tcx/v2/
The gps data stored by the Nike+ application doesn't contain the time. It is calculated and could not be 100% accurate., (*8)
If you have any problem using the script or want to see new features, please send an email to nikeplusexport@guelpa.me, (*9)