Usage

The Nike+PHP class is easy to use and with just a few lines of code, you’ll have an easy to use PHP array. With Nike+PHP you can use one or two of our functions to extract almost any piece of data that Nike hold.

You need to know your Nike ID and you can find this by filling in the form on the Nike ID page. Once you’ve entered your details, submit the form and you’ll be show your unique public Nike ID.

Calling the class – NikePlusPHP

You MUST pass your unique ID to the class, you can pass a second optional value (either true or false) which will either convert all distances in to miles or leave as kilometres.

<?php
	require_once 'nikeplusphp.1.2.2.php';
	$nikePHP = new NikePlusPHP(0123456789, true);
?>

All of the following examples assume that the Nike+PHP file has already been included.

Get all profile information – profile()

No paramaters are required. An array is returned with all of the profile information Nike+ holds.

<?php
	$nikePHP = new NikePlusPHP(0123456789);
	$profile = $nikePHP->profile();
	print_r($profile);
?>

Get an overview of all your runs – fullRunInfo()

No paramaters are required. An array is returned with a list of all of the information Nike+ holds.

<?php
	$nikePHP = new NikePlusPHP(0123456789);
	$np = $nikePHP->fullRunInfo();
	print_r($np);
?>

Get a basic overview of all your runs – basicRunInfo()

No paramaters are required. An array is returned with a list of the key information Nike+ holds.

<?php
	$nikePHP = new NikePlusPHP(0123456789);
	$np = $nikePHP->basicRunInfo();
	print_r($np);
?>

Get all information on an individual run – getRun($runId)

Unique run ID is required. An array is returned with all the information held for a particular run.

<?php
	$nikePHP = new NikePlusPHP(0123456789);
	$np = $nikePHP->getRun($runId);
	print_r($np);
?>

Get all information on the first run – basicFirstRun()

No paramaters are required. An array is returned with basic information for the first run.

<?php
	$nikePHP = new NikePlusPHP(0123456789);
	$np = $nikePHP->basicFirstRun();
	print_r($np);
?>

Get all information on the last run – basicLastRun()

No paramaters are required. An array is returned with basic information for the last run.

<?php
	$nikePHP = new NikePlusPHP(0123456789);
	$np = $nikePHP->basicLastRun();
	print_r($np);
?>

Get basic information on the runs between two dates – runsBetweenDates($startDate, $endDate)

A start and an end date are required.

<?php
	$nikePHP = new NikePlusPHP(0123456789);
	$np = $nikePHP->runsBetweenDates($startDate, $endDate);
	print_r($np);
?>

Get basic information on the runs between two distances – runsBetweenDistances($minDistance, $maxDistance)

A minimum and maximum distance are required.

<?php
	$np = NikePlusPHP(0123456789);
	$np = $nikePHP->runsBetweenDistances($minDistance, $maxDistance);
	print_r($np);
?>

Get basic information on the runs between two times – runsBetweenDurations($startTime, $endTime)

A minimum and maximum time are required.

<?php
	$nikePHP = new NikePlusPHP(0123456789);
	$np = $nikePHP->runsBetweenDurations($minTime, $maxTime);
	print_r($np);
?>

Get basic information on runs since a date – runsSinceDate($startDate)

A minimum and maximum time are required.

<?php
	$nikePHP = new NikePlusPHP(0123456789);
	$np = $nikePHP->runsSinceDate($startDate);
	print_r($np);
?>

Get basic information on runs before a date – runsBeforeDate($endDate)

A minimum and maximum time are required.

<?php
	$nikePHP = new NikePlusPHP(0123456789);
	$np = $nikePHP->runsBeforeDate($endDate);
	print_r($np);
?>

Get basic information on runs over a distance – runsOverDistance($minDistance)

A minimum and maximum time are required.

<?php
	$nikePHP = new NikePlusPHP(0123456789);
	$np = $nikePHP->runsOverDistance($minDistance);
	print_r($np);
?>

Get basic information on runs under a distance – runsUnderDistance($maxDistance)

A maximum distance is required.

<?php
	$nikePHP = new NikePlusPHP(0123456789);
	$np = $nikePHP->runsUnderDistance($maxDistance);
	print_r($np);
?>

Get basic information on runs over a certain distance – runsOverDuration($minTime)

A minimum time is required. An array with runs after a certain date.

<?php
	$nikePHP = new NikePlusPHP(0123456789);
	$np = $nikePHP->runsOverDuration($minTime);
	print_r($np);
?>

Get basic information on runs before a date – runsUnderDuration($maxTime)

A maximum time is required. An array with runs before a certain date.

<?php
	$nikePHP = new NikePlusPHP(0123456789);
	$np = $nikePHP->runsUnderDuration($maxTime);
	print_r($np);
?>

Get just time information for all runs – getTimes()

No paramaters are required. You will get start times, durations and other time information for each run.

<?php
	$nikePHP = new NikePlusPHP(0123456789);
	$np = $nikePHP->getTimes();
	print_r($np);
?>

Get the total amount of time spent running – totalRunTime()

No paramaters are required. You will get a number that indicates how many seconds you have run for in total.

<?php
	$nikePHP = new NikePlusPHP(0123456789);
	$np = $nikePHP->totalRunTime();
	print_r($np);
?>

Get the total distance run – totalDistance()

No paramaters are required. You will get a number that indicates how far you have run in total.

<?php
	$nikePHP = new NikePlusPHP(0123456789);
	$np = $nikePHP->totalDistance();
	print_r($np);
?>

Get the total calories used – totalCalories()

No paramaters are required. You will get a number that indicates how many calories you have used.

<?php
	$nikePHP = new NikePlusPHP(0123456789);
	$np = $nikePHP->totalCalories();
	print_r($np);
?>

Get graph plotting data – getGraphPoints()

Run ID required. You get a string that makes it easy to plot the points on a graph.

<?php
	$nikePHP = new NikePlusPHP(0123456789);
	$np = $nikePHP->getGraphPoints($runId);
	print_r($np);
?>

Having trouble using Nike+PHP? Get in touch!

Search engine optimization by SEO Design Solutions