freeCodeCamp / freeCodeCamp

freeCodeCamp.org's open-source codebase and curriculum. Learn to code for free.
http://contribute.freecodecamp.org/intro
BSD 3-Clause "New" or "Revised" License
393.45k stars 36.18k forks source link

How are we supposed to complete the Twitch project now? #11015

Closed evanwike closed 7 years ago

evanwike commented 7 years ago

Challenge Name

Twitch.tv JSON API

Issue Description

The $.getJSON using jsonp work-around that FCC posted no longer works.

$.getJSON(`https://api.twitch.tv/kraken/streams/freecodecamp?callback=?`, data => {
    console.log(data)
})

No matter what channel you use in the url, you still get 'Bad Request', 'No client id specified', 400. So my question is, how are we supposed to still be able to complete this project if we aren't supposed to use our Client ID on Codepen pages?

texas2010 commented 7 years ago

@Dirtier, this has already been fixed. We should be pushing this change to production shortly!

zelite commented 7 years ago

I understand that this issue is closed that that there's already a workaround to avoid needing a Twitch account and a Client ID.

However, I would just like to comment that there have been many posts about needing a client ID which do not understand that the client ID is not the same thing as a API key and does not need to be kept secret.

from here: https://github.com/justintv/Twitch-API/blob/master/authentication.md

Client IDs are public and can be shared (e.g. embedded in the source of a web page),

Some interactions with the twitch API will require authentication. For that you will use the client secret. The client secret must be kept confidential.

For the requests that are necessary for the Twitch API project, you do not need to be authenticated, you just need the Client ID.

On the wiki article ( http://forum.freecodecamp.com/t/use-the-twitchtv-json-api/19541 ) it is incorrectly stated:

Twitch has changed their API and now requires an API key in order to run queries. If you are using CodePen or GitHub pages to build these, we do not recommend adding an API key to your project for security reasons.

Note, that I think having the "sample reply" data is a good solution so that people aren't required to open an account on a third party website, but the reasons for doing so should be correctly explained to the campers. The way it stands we are misinforming them.