beam.proから情報を取得する
beam.proは新鋭のゲームストリーミング配信サイト。
最近マイクロソフトに買収されたらしいのでXBOX系のゲームとのコラボが強化されるのかもしれない。
ゲーム配信に特化した配信サイトといえばhitboxがあげられるが、beam.proはよりラグが少ないとのうわさもある。
Rest APIのマニュアル
https://dev.beam.pro/rest.html#
エンドポイント
https://beam.pro/api/v1/
全チャンネル取得(配信中のみ)
https://beam.pro/api/v1/channels
個別のチャンネル情報取得
https://beam.pro/api/v1/channels/hogehoge
<?php $info = beam_info(); var_dump($info); function beam_info(){ $url_base = "https://beam.pro/api/v1/channels/"; $beam_id = "test"; $url = $url_base . $beam_id ; $json = file_get_contents($url); $contents = json_decode($json, true); //var_dump($contents); $info['isLive'] = $contents['online']; $info['viewers'] = $contents['viewersCurrent']; $info['title'] = $contents['protected']; $info['created_at'] = $contents['updatedAt']; $info['id'] = $contents['id']; $info['channel_name'] = $contents['name']; $info['user_name'] = $contents['user']['username']; $info['url'] = "https://beam.pro/" . $contents['token']; $info['archive_url'] = ""; $info['snapshot'] = $contents['cover']['url']; $info['lastDate'] = ""; return $info; }
ところでこのブログのアクセス解析を見ると、最近cavetubeからの訪問者がいらっしゃったようだ。
どこかの配信でとりあげられたのだろうか。自分の用の備忘録過疎ブログではあるが、人が来るのは素直にうれしい。