symm/viewranger-api-client

This package is abandoned and no longer maintained. No replacement package was suggested.

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: 2023-05-09 00:34:20 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();
}