sevenpluss/twitch-api

Twitc Helix API

1.0.0 2019-05-28 01:29 UTC

This package is auto-updated.

Last update: 2024-09-28 13:03:56 UTC


README

Latest Stable Version Total Downloads License

注意: 此库使用最新的 Twitch HELIX API,该 API 功能尚不完整

目录

  1. 安装
  2. 使用示例
  3. 配置
  4. 文档

安装

最低要求: php 7.1

composer require sevenpluss/twitch-api

或将 sevenpluss/twitch-api 添加到您的 composer.json

"sevenpluss/twitch-api": "^1.0"

运行 composer update 以拉取最新版本。

使用示例

<?php

namespace YourApp\Http\Controllers;

use Sevenpluss\TwitchApi\Services\TwitchApi;
use Sevenpluss\TwitchApi\Services\ClientSettings;

class VideoController
{
    protected $api;
    
    public function __construct() 
    {
        // make a self extended ClientSettings class with custom settings
        $settings = new ClientSettings('client_id', 'client_secret', 'redirect_url');
        
        $this->api = new TwitchApi($settings);
        
    }
    
    public function index()
    {
        $videos = $this->api->videos()->getVideosByUserId('31239503')->data();
        
        return compact('videos');
    }
}

配置

  1. Laravel 配置

文档

Twitch Helix API 文档: https://dev.twitch.tv/docs/api/reference

从 Twitch 服务器封装在 Services/Result 对象中的 everyone 响应。

  1. 分析
  2. Bits 领航板
  3. 剪辑
  4. 权益
  5. 游戏
  6. 直播
  7. 主播
  8. 标签
  9. 用户
  10. 视频
  11. WebHooks
  12. 认证
  13. 分页器