I'm stuck at a Project, what should I do? Talk to me dear friends!

I'm stuck at a Project, what should I do? Talk to me dear friends!
0

#1

Hello! So I’m stuck at the Twitch API project, I’m starting to doubt myself and can’t seem to understand what I need to do to make it right, it is my last intermediate project.

What I know is that I’m lacking on understanding the concepts of calling API’s and how to work with the data that is given, which is odd because I did all the other projects that requested the same -.-’

So… I just want to know what do you think I should do, go back to the basics of javascript to refresh my mind with all the code or should I check some Jquery Ajax videos?

I don’t know really what to do to keep going…

Thanks for listening!


#2

The tricky part of twitch.tv is ajax, so I would recommend learning more about ajax. Also, at what point you are stuck exactly? Did you manage to get something done? Do you use id code when sending request?


#3

Yeah sorry for my uninformed post!

Well I did get the information that I wanted using on of the arrays (on of the streamers) and i could place it in my body’s page… but when I used my variable which include all the streamers ([“ESL_SC2”, “OgamingSC2”, “cretetion”, “freecodecamp”, “storbeck”, “habathcx”, “RobotCaleb”, “noobs2ninjas”]) my call didn’t give any response because it searched all the streamer’s name all together in a single call.

I couldn’t figure it out how to “split” the array into pieces that when i call the api, it searched for all the streamers separately.

Sorry for my bad english, I can explain better if you don’t understand what I’m saying.

Thanks for the reply


#4

get chrome > install postman extension and use that to make calls on your unique twitch code

your twitch code must have your unique user ID btw which you get only if you register, accounts are free btw

postman helps you visualize easier the object your are getting from the call

Use a for loop for your array and make one call at a time. I used the each function from jquery for mine.

I have like 3 different calls actually on my pen because the object returned via codepen.io isn’t complete. On postman however i see the complete objects.


#5

Is it like JSONview extension?


#6

Do you have a CodePen project you could provide so that we can see your code? It seems like you aren’t having a problem with the actual Twitch request, but just dealing with the array. What I’d suggest is the forEach() function.

var users = ["ESL_SC2", "OgamingSC2", "cretetion", "freecodecamp", "storbeck", "habathcx", "RobotCaleb", "noobs2ninjas"];

users.forEach(function(user) {
   // This function lets you use each name one at a time.
   console.log(user);
});

Remember, feeling confused and lost is absolutely a normal part of the learning process. Don’t doubt yourself, because everyone goes through the same thing :thumbsup:


#7

omg i completely forgot the foreach…I will try this I think you might saved my work!! I’ll be offline this weekend but I’l post it later this week!

Thanks for the reply :slight_smile: