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: about 1 year 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 (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2019-01-05T23:04:18.000Z (over 7 years ago)
- Last Synced: 2024-04-14T20:11:41.074Z (about 2 years 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
================================================
[](https://travis-ci.org/svilborg/php-roku)
[](https://packagist.org/packages/svilborg/php-roku)
[](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 Library
Usage
=====
Execute commands :
```php
$roku = new \Roku\Roku("192.168.72.10", 8060, 0.2);
$roku->up();
$roku->select();
$roku->literals("test@gmail.com");
$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 test@gmail.com 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 test@gmailc.om 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`.