symm/viewranger-api-client

Client for the ViewRanger API

dev-master / 1.0.x-dev 2014-08-30 16:44 UTC

This package is not auto-updated.

Last update: 2020-07-06 11:37:38 UTC


README

Build Status

A PHP client for the ViewRanger Beacon API

Get the latest Beacon

require_once('vendor/autoload.php');

use Symm\ViewRangerClient\ViewRangerClient;

$client     = ViewRangerClient::create('YOUR_API_KEY_HERE');
$lastBeacon = $client->getLastBeaconPosition('your-email@address.com', 1234);

print $beacon->getLocation();
print $beacon->getHeading();
print $beacon->getSpeed();

Get Beacons between two given timestamps

$start   = new \DateTime('2014-08-11');
$end     = new \DateTime('2014-08-12');
$beacons = $client->getBeaconPositions('your-email@address.com', 1234, $start, $end);

foreach ($beacons as $beacon) {
    print $beacon->getLocation();
    print $beacon->getHeading();
    print $beacon->getSpeed();
}