PHP code example of ozankurt / livecoding-api

1. Go to this page and download the library: Download ozankurt/livecoding-api library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

ozankurt / livecoding-api example snippets


use Kurt\LiveCoding\Client;
use Kurt\LiveCoding\LiveCoding;

$storagePath = __DIR__.'/storage/livecoding';

$liveCodingClient = new Client([
    'id' => 'CLIENT_ID', // ace are accepted as a valid scope.
     * By default ReadScope will be instantiated.
     */
    'scope' => new Kurt\LiveCoding\Scopes\ReadScope, // optional

    /** 
     * All classes under Kurt\LiveCoding\Storages namespace are accepted as a valid scope.
     * In order to use FileStorage you have to specify a storage path.
     * By default SessionStorage will be instantiated.
     */
    'storage' => new Kurt\LiveCoding\Storages\FileStorage($storagePath), // optional
]);

$liveCoding = new LiveCoding($liveCodingClient);

if (!$liveCoding->isAuthorized()) {
    echo '<a href='.$liveCoding->getAuthLink().'>Connect My LiveCodingTV Account</a>';
} else {
    $results = $liveCoding->users('ozankurt');
}