dev-master
9999999-devA PHP library for getting performance indicator from Alexa (http://www.alexa.com)
MIT
The Requires
The Development Requires
A PHP library for getting performance indicator from Alexa (http://www.alexa.com)
A PHP library for dealing with Geckoboard API (http://www.geckoboard.com), (*2)
The best way to install the library is by using Composer. Add the following to composer.json
in the root of your project:, (*3)
``` javascript { "require": { "carlosio/geckoboard": "dev-master" } }, (*4)
Then, on the command line: ``` bash curl -s http://getcomposer.org/installer | php php composer.phar install
Use the generated vendor/autoload.php
file to autoload the library classes., (*5)
<?php require __DIR__ . '/vendor/autoload.php'; use CarlosIO\Geckoboard\Widgets\NumberAndSecondaryStat; use CarlosIO\Geckoboard\Client; $myWidget = new NumberAndSecondaryStat(); $myWidget->setId('<your widget id>'); $myWidget->setMainValue(123); $myWidget->setSecondaryValue(238); $myWidget->setMainPrefix('EUR'); $geckoboardClient = new Client(); $geckoboardClient->setApiKey('<your token>'); $geckoboardClient->push($myWidget);
use CarlosIO\Geckoboard\Widgets\NumberAndSecondaryStat; use CarlosIO\Geckoboard\Client; $myWidget = new NumberAndSecondaryStat(); $myWidget->setId('<your widget id>'); $myWidget->setMainValue(123); $myWidget->setSecondaryValue(238); $myWidget->setMainPrefix('EUR'); $geckoboardClient = new Client(); $geckoboardClient->setApiKey('<your token>'); $geckoboardClient->push($myWidget);
use CarlosIO\Geckoboard\Data\Entry; use CarlosIO\Geckoboard\Widgets\RagNumbers; use CarlosIO\Geckoboard\Client; $myWidget = new RagNumbers(); $myWidget->setId('<your widget id>'); $redData = new Entry(); $redData->setValue(132)->setText('This is the red description'); $myWidget->setRedData($redData); $amberData = new Entry(); $amberData->setValue(134)->setText('This is the amber description'); $myWidget->setAmberData($amberData); $greenData = new Entry(); $greenData->setValue(34)->setText('This is the green description'); $myWidget->setGreenData($greenData); $geckoboardClient->push($myWidget);
use CarlosIO\Geckoboard\Data\Entry; use CarlosIO\Geckoboard\Widgets\RagColumnAndNumbers; use CarlosIO\Geckoboard\Client; $myWidget = new RagColumnAndNumbers(); $myWidget->setId('<your widget id>'); $redData = new Entry(); $redData->setValue(132)->setText('This is the red description'); $myWidget->setRedData($redData); $amberData = new Entry(); $amberData->setValue(13)->setText('This is the amber description'); $myWidget->setAmberData($amberData); $greenData = new Entry(); $greenData->setValue(3)->setText('This is the green description'); $myWidget->setGreenData($greenData); $geckoboardClient->push($myWidget);
use CarlosIO\Geckoboard\Widgets\Text; use CarlosIO\Geckoboard\Data\Text\Item; use CarlosIO\Geckoboard\Client; $myWidget = new Text(); $firstItem = new Item(); $secondItem = new Item(); $firstItem->setText('Test message 1'); $secondItem->setText('Test message 2'); $secondItem->setType(Item::TYPE_ALERT); $myWidget->addItem($firstItem); $myWidget->addItem($secondItem); $geckoboardClient->push($myWidget);
use CarlosIO\Geckoboard\Data\Funnel\Entry; use CarlosIO\Geckoboard\Widgets\Funnel; $myWidget = new Funnel(); $myWidget->setId('29473-d7ae87e3-ac3f-4911-95ce-ec91439a4170'); $myWidget->setType('reversed'); $myWidget->setShowPercentage(false); $error = new Entry(); $error->setLabel('Step 1')->setValue(87809); $myWidget->addEntry($error); $error = new Entry(); $error->setLabel('Step 2')->setValue(70022); $myWidget->addEntry($error); $error = new Entry(); $error->setLabel('Step 3')->setValue(63232); $myWidget->addEntry($error); $error = new Entry(); $error->setLabel('Step 4')->setValue(53232); $myWidget->addEntry($error); $error = new Entry(); $error->setLabel('Step 5')->setValue(32123); $myWidget->addEntry($error); $error = new Entry(); $error->setLabel('Step 6')->setValue(23232); $myWidget->addEntry($error); $error = new Entry(); $error->setLabel('Step 7')->setValue(12232); $myWidget->addEntry($error); $error = new Entry(); $error->setLabel('Step 8')->setValue(2323); $myWidget->addEntry($error); $geckoboardClient->push($myWidget);
In order to run the test, update php composer.phar update --dev
, (*11)
$ bin/phpunit --coverage-text
A PHP library for getting performance indicator from Alexa (http://www.alexa.com)
MIT