Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/aapis/libducksboardapi
Ducksboard (http://ducksboard.com) has an API, but no PHP library. Now it does.
https://github.com/aapis/libducksboardapi
Last synced: 23 days ago
JSON representation
Ducksboard (http://ducksboard.com) has an API, but no PHP library. Now it does.
- Host: GitHub
- URL: https://github.com/aapis/libducksboardapi
- Owner: aapis
- Created: 2014-01-17T20:47:44.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2014-01-20T20:14:09.000Z (almost 11 years ago)
- Last Synced: 2024-10-15T10:29:55.764Z (2 months ago)
- Language: PHP
- Size: 227 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
libducksboardapi
================Ducksboard (http://ducksboard.com) has an API, but no PHP library. Now it does. This makes it a lot quicker to create dashboard widgets than manually running cURL queries in the terminal.
## Usage
**Push data to a widget**
```php
$ducksboard = new DucksboardAPI("push", array($data, $API->slot, $API->key));
$result = $ducksboard->runAction(true);
```**Pull data from a widget**
```php
$ducksboard = new DucksboardAPI("pull", array($API->endpoint, $API->slot, $API->key));
$result = $ducksboard->runAction(true);
```**Pull data from all, or a specific dashboard**
```php
$ducksboard = new DucksboardAPI("dashboard", array($API->request_type, $API->dashboard_slug, $API->key));
$result = $ducksboard->runAction(true);
```## Run multiple requests in a row
```php
$ducksboard = new DucksboardAPI("dashboard", array($API->request_type, $API->dashboard_slug, $API->key));
$result = $ducksboard->runAction(true);// ... some other code here ...
$newDataSet = array(...);
$ducksboard->runAction(true, $newDataSet);
```So long as you want to run the same action multiple times (i.e. insert multiple items into a widget, create several dashboards, etc) you can just keep referencing the object which instantiates the type of request you want to run.
|Method|Arguments|
|:----:|---------|
|DashboardAPI|string $type, array $parameters|
|DashboardAPI::runAction|boolean $json, stdClass $data|## "Copyright"
Obviously this is open source and also WTFPL licensed, but it was originally written for use in a project at http://wearefree.ca so I feel there should be at least be a link pointing people to where they can find the final product.