freeCodeCamp/curriculum/challenges/chinese/10-coding-interview-prep/take-home-projects/use-the-twitch-json-api.md

38 lines
2.9 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

---
id: bd7158d8c442eddfaeb5bd1f
challengeType: 3
videoUrl: ''
localeTitle: 使用Twitch JSON API
---
## Description
<section id="description"> <strong>目标:</strong>构建一个功能类似于此的<a href="https://codepen.io" target="_blank">CodePen.io</a>应用程序: <a href="https://codepen.io/freeCodeCamp/full/Myvqmo/" target="_blank">https</a> <strong></strong> <a href="https://codepen.io" target="_blank">//codepen.io/freeCodeCamp/full/Myvqmo/</a> 。完成以下<a href="https://en.wikipedia.org/wiki/User_story" target="_blank">用户故事</a> 。使用您需要的任何库或API。给它你自己的个人风格。 <strong>用户故事:</strong>我可以看到freeCodeCamp当前是否在Twitch.tv上流式传输。 <strong>用户故事:</strong>我可以点击状态输出并直接发送到freeCodeCamp的Twitch.tv频道。 <strong>用户故事:</strong>如果Twitch用户当前正在播放我可以看到有关他们正在播放的内容的其他详细信息。 <strong>提示:</strong>请参阅<a href="http://forum.freecodecamp.org/t/use-the-twitchtv-json-api/19541" target="_blank">http://forum.freecodecamp.org/t/use-the-twitchtv-json-api/19541上</a>对Twitch.tv的JSONP API的示例调用。 <strong>提示:</strong>有关此API调用的相关文档位于 <a href="https://dev.twitch.tv/docs/v5/reference/streams/#get-stream-by-user" target="_blank">https</a> <a href="https://dev.twitch.tv/docs/v5/reference/streams/#get-stream-by-user" target="_blank">//dev.twitch.tv/docs/v5/reference/streams/#get-stream-by-user</a><strong>提示:</strong>这是定期传输的人的Twitch.tv用户名数组 <code>[&quot;ESL_SC2&quot;, &quot;OgamingSC2&quot;, &quot;cretetion&quot;, &quot;freecodecamp&quot;, &quot;storbeck&quot;, &quot;habathcx&quot;, &quot;RobotCaleb&quot;, &quot;noobs2ninjas&quot;]</code> <strong>更新:</strong>由于<a href="https://blog.twitch.tv/client-id-required-for-kraken-api-calls-afbb8e95f843#.f8hipkht1" target="_blank">此处</a>解释的API使用条件发生变化Twitch.tv现在需要API密钥但我们已经构建了一种解决方法。使用<a href="https://wind-bow.glitch.me" target="_blank">https://wind-bow.glitch.me/twitch-api</a>而不是twitch的API基本URL即https://api.twitch.tv/kraken您仍然可以获取帐户信息而无需注册API密钥。如果卡住请记得使用<a href="https://forum.freecodecamp.org/t/how-to-get-help-when-you-are-stuck-coding/19514" target="_blank">Read-Search-Ask</a> 。完成后单击“我已完成此挑战”按钮并包含指向CodePen的链接。您可以通过Facebook上的朋友分享您的项目反馈。 </section>
## Instructions
<section id="instructions">
</section>
## Tests
<section id='tests'>
```yml
tests: []
```
</section>
## Challenge Seed
<section id='challengeSeed'>
</section>
## Solution
<section id='solution'>
```js
// solution required
```
/section>