Library to interact with Pebble Timeline API.
Because you love when ...
- It's tested code
- It can be installed with composer
- It follows semver
- It's already used in production
With composer installed
php composer.phar require dav-m85/pebble-api-php:dev-master
// Define a pin with an Array
$pin = new PebbleApi\Pin("reservation-1395203", new \DateTime("2014-03-07T09:01:10.229Z"), array(
"layout" => array(
...
)
));
// Or using object oriented approach (still work in progress)
$layout = new PebbleApi\Layout\GenericLayout();
$layout->setForegroundColor(PebbleApi\LayoutInterface::COLOR_BLUE);
$pin = new PebbleApi\Pin("reservation-1395203", new \DateTime("2014-03-07T09:01:10.229Z"), $layout);
$pin->setDuration(120);
// Then spawn a client
$client = new PebbleApi\Client();
// Create (or update) a pin
$user = new PebbleApi\User($userToken);
$client->put($user, $pin);
// Delete a pin
$client->delete($user, $pin);
// Create a pin for all users (shared pin)
$sharedTopic = new PebbleApi\SharedTopic($apiToken, array('baseball', 'giants'));
$client->put($sharedTopic, $pin);