Giter Club home page Giter Club logo

php-roku's Introduction

Roku PHP Library

Build Status Latest Stable Version Latest Unstable Version

PHP Library for communication with Roku External Control Protocol

Installation

Installing via Composer

Install composer in a common location or in your project:

curl -s http://getcomposer.org/installer | php

Create the composer.json file as follows:

{ 
    "require": {
        "svilborg/php-roku": "dev-master"
    }
}

Run the composer installer:

php composer.phar install

Requirements

  • PHP Version >=5.3.2.
  • PHP Httpful Library

Usage

Execute commands :

$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 :

$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 :

$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 :

$ vendor/bin/roku --help

It displays :

PHP Roku Console

Usage: roku [OPTION] ..

-h <host>       Host
-p <port>       Port
-d <delay>      Delay between each command
-i              Interactive mode (Listens for keyboard keystrokes)
-c <commands>   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 :

$ 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.

php-roku's People

Contributors

svilborg avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

php-roku's Issues

Can't not install

Hi, I cannot install php-roku I have PHP 7.1.9 and composer but, I am not able to install php-roku.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.