sevenpluss / twitch-api
Twitc Helix API
1.0.0
2019-05-28 01:29 UTC
Requires
- php: >=7.1.3
- ext-curl: *
- guzzlehttp/guzzle: ^6.3
This package is auto-updated.
Last update: 2024-09-28 13:03:56 UTC
README
注意: 此库使用最新的 Twitch HELIX API,该 API 功能尚不完整
目录
安装
最低要求: 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'); } }
配置
文档
Twitch Helix API 文档: https://dev.twitch.tv/docs/api/reference
从 Twitch 服务器封装在 Services/Result 对象中的 everyone 响应。