Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/svilborg/php-roku
PHP Roku
https://github.com/svilborg/php-roku
composer php php-library php-roku roku roku-device roku-tv
Last synced: 2 months ago
JSON representation
PHP Roku
- Host: GitHub
- URL: https://github.com/svilborg/php-roku
- Owner: svilborg
- License: apache-2.0
- Created: 2014-07-31T22:43:44.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2019-01-05T23:04:18.000Z (about 6 years ago)
- Last Synced: 2024-04-14T20:11:41.074Z (10 months ago)
- Topics: composer, php, php-library, php-roku, roku, roku-device, roku-tv
- Language: PHP
- Size: 38.1 KB
- Stars: 15
- Watchers: 2
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Roku PHP Library
================================================[![Build Status](https://api.travis-ci.org/svilborg/php-roku.png?branch=master)](https://travis-ci.org/svilborg/php-roku)
[![Latest Stable Version](https://poser.pugx.org/svilborg/php-roku/v/stable.png)](https://packagist.org/packages/svilborg/php-roku)
[![Latest Unstable Version](https://poser.pugx.org/svilborg/php-roku/v/unstable.png)](https://packagist.org/packages/svilborg/php-roku)PHP Library for communication with Roku External Control Protocol
Installation
================Installing via Composer
-----------------------
Install composer in a common location or in your project:```bash
curl -s http://getcomposer.org/installer | php
```Create the composer.json file as follows:
```json
{
"require": {
"svilborg/php-roku": "dev-master"
}
}
```Run the composer installer:
```bash
php composer.phar install
```Requirements
============* PHP Version >=5.3.2.
* PHP Httpful LibraryUsage
=====Execute commands :
```php
$roku = new \Roku\Roku("192.168.72.10", 8060, 0.2);
$roku->up();
$roku->select();
$roku->literals("[email protected]");
$roku->down();
$roku->down();
$roku->select();
```
List the applicatioin installed on the device :
```php
$roku = new \Roku\Roku("192.168.72.10", 8060, 0.2);
$applications = $roku->apps();
foreach ($applications as $application) {
echo $application->getId();
echo $application->getVersion();
echo $application->getName();
echo "\n";
}```
Get device information :
```php
$roku = new \Roku\Roku("192.168.72.10", 8060, 0.2);
$device = $roku->device();
echo $device->getSerialNumber();
echo $device->getModelName();
echo $device->getModelDescription();
// etc..```
Usage Commandline
=================For the list of commands execute :
```bash
$ vendor/bin/roku --help
```
It displays :
```bash
PHP Roku Console
Usage: roku [OPTION] ..
-h Host
-p Port
-d Delay between each command
-i Interactive mode (Listens for keyboard keystrokes)
-c Command mode (Specify commands to be executed, Example -c "up down [email protected] down select home")
-t Test Mode (Does not send commands.Just simulates them.)
--help Shows this help```
Example usage of command and interactive modes :
```bash
$ vendor/bin/roku -h 192.168.72.10 -p 8060 -d 1 -c "up [email protected] down down select home"
$ vendor/bin/roku -h 192.168.72.10 -d 1 -i
```
Running the tests
=================First, install PHPUnit with `composer.phar install --dev`, then run
`./vendor/bin/phpunit`.