2017 © Pedro Peláez
 

library phpebble

Package to interact with Pebble APIs

image

link0/phpebble

Package to interact with Pebble APIs

  • Saturday, September 12, 2015
  • by link0
  • Repository
  • 1 Watchers
  • 0 Stars
  • 7 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

Phpebble

Latest Stable Version Total Downloads License Scrutinizer Code Quality Code Coverage Build Status, (*1)

This package encapsulates external services provided by Pebble to interact with the Pebble Smartwatch, (*2)

License: MIT, (*3)

Usage

You can install using composer, (*4)

composer require link0/phpebble, (*5)

Quickstart

<?php

use GuzzleHttp\Client;
use Link0\Phpebble\Api\GuzzleTimeline;
use Link0\Phpebble\Api\InvalidPinObject;
use Link0\Phpebble\Api\InvalidTimelineToken;
use Link0\Phpebble\Api\RateLimitExceeded;
use Link0\Phpebble\Api\ServiceUnavailable;
use Link0\Phpebble\Api\TimelineToken;
use Link0\Phpebble\Pin;

require_once('vendor/autoload.php');

$token = TimelineToken::fromString('0123456789abcdef0123456789abcdef');
$pin = Pin::create('foo-31337', new \DateTimeImmutable(), 'Some title');

$api = new GuzzleTimeline(new Client(), $token);

try {
    $api->push($pin);
    printf("%s\n", "Succesfully processed Pin " . $pin->id());
}
catch(InvalidPinObject $ipo) {
    printf("%s\n", $ipo->getMessage());
    print_r($ipo->pin());
}
catch(InvalidTimelineToken $itt) {
    printf("%s\n", $itt->getMessage());
    print_r($itt->timelineToken());
}
catch(RateLimitExceeded $rle) {
    printf("%s\n", $rle->getMessage());
}
catch(ServiceUnavailable $su) {
    printf("%s\n", $su->getMessage());
}

The Versions

12/09 2015

dev-master

9999999-dev

Package to interact with Pebble APIs

  Sources   Download

MIT

The Requires

  • php >=5.5

 

The Development Requires

12/09 2015

v0.1.1

0.1.1.0

Package to interact with Pebble APIs

  Sources   Download

MIT

The Requires

  • php >=5.5

 

The Development Requires

12/09 2015

v0.1.0

0.1.0.0

Package to interact with Pebble APIs

  Sources   Download

MIT

The Requires

  • php >=5.5

 

The Development Requires