padhie / twitch-api-bundle
Twitch-Api 简单客户端 https://dev.twitch.tv/docs/api/reference
2.0.4
2023-11-18 10:23 UTC
Requires
- php: ^8.2
- ext-curl: *
- ext-json: *
- guzzlehttp/guzzle: ^7.4
- guzzlehttp/promises: ^1.5
- guzzlehttp/psr7: ^2.1
- psr/http-message: ^1.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.6
- maglnet/composer-require-checker: ^3.8
- phpstan/phpstan: ^1.5
- phpunit/phpunit: ^9.6
- rector/rector: ^0.18.10
- dev-master
- 2.0.4
- 2.0.3
- 2.0.2
- 2.0.1
- 2.0.0
- 2.0.0-BETA2
- 2.0.0-BETA1
- 1.2.4
- 1.2.3
- 1.2.2
- 1.2.1
- 1.2.0
- 1.1.15
- 1.1.14
- 1.1.13
- 1.1.12
- 1.1.11
- 1.1.9
- 1.1.8
- 1.1.7
- 1.1.5
- 1.1.4
- 1.1.2
- 1.0.7
- 1.0.5
- 1.0.1
- 1.0.0
- dev-php-8.2
- dev-dependabot/composer/guzzlehttp/psr7-2.4.5
- dev-multiple_stream_search
- dev-dependabot/composer/guzzlehttp/guzzle-7.4.5
- dev-master_v1
This package is auto-updated.
Last update: 2024-09-18 12:05:51 UTC
README
Twitch-Api 简单客户端 https://dev.twitch.tv/docs/api/reference
如何使用
创建客户端
// see https://dev.twitch.tv/docs/authentication/getting-tokens-oauth $clientId = 'CLIENT_ID'; $authorization = 'AUTHORIZATION'; $client = new \Padhie\TwitchApiBundle\TwitchClient( new \GuzzleHttp\Client(), new \Padhie\TwitchApiBundle\Request\RequestGenerator($clientId, $authorization), new \Padhie\TwitchApiBundle\Response\ResponseGenerator(), );
发送单个请求
$request = new \Padhie\TwitchApiBundle\Request\Channels\GetChannelInformationRequest($broadcasterId); $response = $client->send($request); assert($response instanceof \Padhie\TwitchApiBundle\Response\Channels\GetChannelInformationResponse); $title = $response->getChannels()[0]->getTitle();
发送分页请求
$request = new \Padhie\TwitchApiBundle\Request\Users\GetUsersFollowsRequest($broadcasterId); $response = $client->sendWithPagination($request); assert($response instanceof \Padhie\TwitchApiBundle\Request\Users\GetUsersFollowsResponse); $users = $response->getUsers();
待办事项
- 实现命名空间
- 广告
- 分析
- Bits
- ChannelPoints
- 频道
- 聊天
- 剪辑
- 权益
- EventSub
- 扩展
- 游戏
- 目标
- HypeTrain
- 管理
- 音乐
- 投票
- 预测
- 日程
- 搜索
- 直播
- 订阅
- 标签
- 团队
- 用户
- 视频
- 带有响应示例的测试(来自文档)
- 实现并行请求
- 实现异步请求