ozankurt / livecoding-api

LiveCoding.TV API 的 PHP 封装

0.2 2017-01-12 12:21 UTC

This package is auto-updated.

Last update: 2024-09-25 00:46:15 UTC


README

Latest Stable Version Latest Unstable Version License Total Downloads Travis-CI Code Climate

本包是 LiveCodingTV API 的 PHP 封装。

使用方法

纯 PHP
use Kurt\LiveCoding\Client;
use Kurt\LiveCoding\LiveCoding;

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

$liveCodingClient = new Client([
    'id' => 'CLIENT_ID', // required
    'secret' => 'CLIENT_SECRET', // required
    'redirectUrl' => 'https://:8000/', // required

    /** 
     * All classes under Kurt\LiveCoding\Scopes namespace 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');
}

贡献指南

欢迎任何类型的代码改进或添加。

许可证

LiveCoding-API 是开源软件,受 MIT 许可协议的许可:MIT 许可协议