impatricklol/ twitchapi
此包最新版本(dev-master)无可用许可信息。
用于Twitch.TV的PHP API
dev-master
2015-01-24 14:17 UTC
Requires
- php: >=5.3.0
This package is not auto-updated.
Last update: 2024-09-24 16:01:14 UTC
README
用于Twitch.tv API的简单PHP类
{ "require": { "impatricklol/twitchapi": "dev-master" } }
使用方法:将'reckful'替换为你想要获取数据的流名称。
<?php include 'twitchAPI.php'; $twitch = new twitchAPI('reckful'); $twitch->getData('display_name'); $twitch->getData('game'); ?>
如果你想要获取多个流的资料,可以这样使用:
<?php include 'twitchAPI.php'; $stream_1 = new twitchAPI('reckful'); $stream_2 = new twitchAPI('sodapoppin'); $stream_1->getData('display_name'); $stream_2->getData('display_name'); ?>
getData 类型:每个getData类型都从twitch的数组中获取。当前可用的数据类型:display_name - 流用户名 status - 当前流的'title' game - 当前正在玩的游戏
注意:此API尚未完成,并将添加更多功能。此脚本是在PHP V 5.6.2上构建的,如果不起作用,建议升级到这个版本 💩🎉